To avoid unexpected problems due to defaults changing, we should choose specific versions of the OS and the compiler. At Oracle we are currently using GCC 10.2.0 so that should be a reasonable version to start with.
JDK-8272005Github Actions build on Linux should define OS and GCC versions
JDK-8284479Github Actions build on Linux should define OS and GCC versions
JDK-8256983GitHub actions: specify the version of each platform OS and compiler