Skip to content

Commit 2fa1e3a

Browse files
Install supported compilers in workflow
1 parent 65b314c commit 2fa1e3a

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,16 @@ jobs:
1414
fail-fast: false
1515

1616
matrix:
17-
os: [ ubuntu-latest, windows-latest ]
18-
build_type: [ Debug, Release ]
19-
c_compiler: [ gcc, clang, cl ]
17+
os: [ ubuntu-latest ]
18+
build_type: [ Debug ]
19+
c_compiler: [ gcc, clang ]
2020
include:
21-
- os: windows-latest
22-
c_compiler: cl
23-
cpp_compiler: cl
2421
- os: ubuntu-latest
2522
c_compiler: gcc
2623
cpp_compiler: g++
2724
- os: ubuntu-latest
2825
c_compiler: clang
2926
cpp_compiler: clang++
30-
exclude:
31-
- os: windows-latest
32-
c_compiler: gcc
33-
- os: windows-latest
34-
c_compiler: clang
35-
- os: ubuntu-latest
36-
c_compiler: cl
3727

3828
steps:
3929
- uses: actions/checkout@v4
@@ -44,12 +34,29 @@ jobs:
4434
shell: bash
4535
run: |
4636
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
37+
38+
- name: Install GCC 14
39+
if: matrix.os == 'ubuntu-latest' && matrix.c_compiler == 'gcc'
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y gcc-14 g++-14
43+
echo "C_COMPILER=gcc-14" >> $GITHUB_ENV
44+
echo "CXX_COMPILER=g++-14" >> $GITHUB_ENV
45+
46+
- name: Install Clang 20
47+
if: matrix.os == 'ubuntu-latest' && matrix.c_compiler == 'clang'
48+
run: |
49+
sudo add-apt-repository "deb http://apt.llvm.org/plucky/ llvm-toolchain-plucky-20 main"
50+
sudo apt-get update
51+
sudo apt-get install -y clang-20
52+
echo "C_COMPILER=clang-20" >> $GITHUB_ENV
53+
echo "CXX_COMPILER=clang++-20" >> $GITHUB_ENV
4754
4855
- name: Configure CMake
4956
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5057
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
5158
run: >
52-
cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }}
59+
cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ env.CXX_COMPILER }} -DCMAKE_C_COMPILER=${{ env.C_COMPILER }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }}
5360
5461
- name: Build
5562
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).

0 commit comments

Comments
 (0)