Skip to content

Commit

Permalink
CI: compile main app with clang and GCC for several versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertnash committed Dec 15, 2023
1 parent e4d8007 commit 3b61739
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/actions/setup-compilers/action.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 7 additions & 4 deletions .github/workflows/main-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 3b61739

Please sign in to comment.