Skip to content

Commit 5024a98

Browse files
authored
run_test_suite.yml: Use a variety of versions of GCC (#366)
Signed-off-by: Sebastian Pipping <[email protected]>
1 parent 3b6caeb commit 5024a98

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

.github/workflows/run_test_suite.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,28 @@ permissions:
3030

3131
jobs:
3232
test_suite:
33-
name: Run the test suite
34-
runs-on: ubuntu-24.04
33+
name: "Run the test suite (GCC ${{ matrix.gcc }}, ${{ matrix.runs-on }})"
34+
runs-on: ${{ matrix.runs-on }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
- runs-on: ubuntu-20.04
40+
gcc: 7
41+
install: g++-7 gcc-7 cpp-7
42+
# GCC 4 to 8 are assumed to behave "the same",
43+
# so we are skipping GCC 8 here to save CI resources
44+
- runs-on: ubuntu-24.04
45+
gcc: 9
46+
install: g++-9 gcc-9 cpp-9
47+
- runs-on: ubuntu-24.04
48+
gcc: 10
49+
install: g++-10 gcc-10 cpp-10
50+
# GCC 10 to 14 are assumed to behave "the same",
51+
# so we are skipping GCC 11, 12, 13 here to save CI resources
52+
- runs-on: ubuntu-24.04
53+
gcc: 14
54+
install:
3555
steps:
3656
- uses: actions/checkout@v4
3757

@@ -65,6 +85,25 @@ jobs:
6585
6686
sudo perl -MCPAN -e 'install(Memory::Process)' # no package in Ubuntu
6787
88+
- name: "Make GCC ${{ matrix.gcc }} systemwide default"
89+
run: |-
90+
set -x -o pipefail
91+
if [[ "${{ matrix.install }}" != "" ]]; then
92+
sudo apt-get update
93+
sudo apt-get install --no-install-recommends --yes -V ${{ matrix.install }}
94+
fi
95+
96+
# Make requested version GCC and GCOV the system default
97+
# before we have an easy way to fully divert "make check"
98+
# off of the default commands
99+
for i in cpp {,x86_64-linux-gnu-}{g++,gcc{,-{ar,nm,ranlib}},gcov{,-{dump,tool}},gfortran} lto-dump ; do
100+
[[ -e /usr/bin/"${i}" ]] || continue
101+
[[ -e /usr/bin/"${i}-${{ matrix.gcc }}" ]] || continue
102+
sudo rm /usr/bin/"${i}"
103+
sudo ln -s "${i}-${{ matrix.gcc }}" /usr/bin/"${i}"
104+
"${i}" --version | head -n1
105+
done
106+
68107
- name: make install
69108
run: |-
70109
set -x -o pipefail
@@ -86,13 +125,13 @@ jobs:
86125
- name: Upload test log as an artifact
87126
uses: actions/upload-artifact@v4
88127
with:
89-
name: "lcov-${{ github.sha }}-${{ runner.os }}-test-log" # .zip
128+
name: "lcov-${{ github.sha }}-${{ runner.os }}-GCC-${{ matrix.gcc }}-test-log" # .zip
90129
path: tests/test.log
91130
if-no-files-found: error
92131

93132
- name: Upload test directory shrapnel as an artifact
94133
uses: actions/upload-artifact@v4
95134
with:
96-
name: "lcov-${{ github.sha }}-${{ runner.os }}-shrapnel" # .zip
135+
name: "lcov-${{ github.sha }}-${{ runner.os }}-GCC-${{ matrix.gcc }}-shrapnel" # .zip
97136
path: tests
98137
#if-no-files-found: error

0 commit comments

Comments
 (0)