diff --git a/.github/actions/setup-compilers/action.yml b/.github/actions/setup-compilers/action.yml new file mode 100644 index 000000000..e25ba1a75 --- /dev/null +++ b/.github/actions/setup-compilers/action.yml @@ -0,0 +1,28 @@ +name: 'Set CC and CXX env vars for the configured compiler' + +inputs: + compiler: + description: 'Use $suite-$version' + required: true + +runs: + using: 'composite' + steps: + shell: bash + run: | + input=${{ inputs.compiler }} + split=(${input//-/ }) + suite=${split[0]} + version=${split[1]} + case $suite in + gnu) + CC=gcc-$version + CXX=g++-$version + ;; + llvm) + CC=clang-$version + CXX=clang++-$version + ;; + esac + echo "CC=$CC" >> $GITHUB_ENV + echo "CXX=$CXX" >> $GITHUB_ENV diff --git a/.github/workflows/main-app.yml b/.github/workflows/main-app.yml index 21e8a9b68..4d2b3c988 100644 --- a/.github/workflows/main-app.yml +++ b/.github/workflows/main-app.yml @@ -24,9 +24,6 @@ env: hemelb_install_prefix: ${{github.workspace}}/install # VMs have 2 cores, double as compilation often IO bound CMAKE_BUILD_PARALLEL_LEVEL: 4 - # Latest Gnu compiler on Ubuntu 22.04 - CC: gcc-12 - CXX: g++-12 jobs: basic-checks: @@ -45,10 +42,16 @@ jobs: fluid_only_build: name: Build in fluid-only mode runs-on: ubuntu-22.04 - + strategy: + matrix: + compiler: [gnu-11, gnu-12, gnu-13, llvm-13, llvm-14, llvm-15] steps: - uses: actions/checkout@v3 + - uses: ./.github/actions/install-hemelb-deps + with: + compiler: matrix.compiler + - uses: ./.github/actions/install-hemelb-deps with: name: fluidonly