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 19, 2023
1 parent e4d8007 commit 28023a0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/actions/setup-compilers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Set CC and CXX env vars for the configured compiler'

inputs:
compiler:
description: 'Use $suite-$version'
required: true

runs:
using: 'composite'
steps:
- name: Set the env vars with some bash
shell: bash
run: |
set -ex
input=${{ inputs.compiler }}
split=(${input//-/ })
suite=${split[0]}
version=${split[1]}
case $suite in
gnu)
echo "CC=gcc-$version" >> $GITHUB_ENV
echo "CXX=g++-$version" >> $GITHUB_ENV
;;
llvm)
echo "CC=clang-$version" >> $GITHUB_ENV
echo "CXX=clang++-$version" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "LDFLAGS=-stdlib=libc++" >> $GITHUB_ENV
;;
esac
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]
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-compilers
with:
compiler: ${{ matrix.compiler }}

- uses: ./.github/actions/install-hemelb-deps
with:
name: fluidonly
Expand Down

0 comments on commit 28023a0

Please sign in to comment.