Skip to content

Commit f2828bc

Browse files
committed
[actions] Run both Clang and GCC on Linux
1 parent 8835709 commit f2828bc

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,36 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [windows-latest, macos-latest, ubuntu-latest]
17+
compiler: [default, gcc, clang]
18+
19+
# Only run "default" on Windows and macOS, but both Clang and GCC on Linux.
20+
exclude:
21+
- os: windows-latest
22+
compiler: gcc
23+
- os: windows-latest
24+
compiler: clang
25+
- os: macos-latest
26+
compiler: gcc
27+
- os: macos-latest
28+
compiler: clang
1729

1830
steps:
1931
- uses: actions/checkout@v2
2032

21-
- name: Configure cmake
22-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
33+
- name: Configure CMake (Linux – GCC)
34+
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
35+
run: |
36+
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
37+
38+
- name: Configure CMake (Linux – Clang)
39+
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
40+
run: |
41+
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
42+
43+
- name: Configure CMake (Windows / macOS – default)
44+
if: matrix.compiler == 'default'
45+
run: |
46+
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
2347
2448
- name: Build
2549
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose

0 commit comments

Comments
 (0)