-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (53 loc) · 2.17 KB
/
linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: linux
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
# https://github.com/actions/virtual-environments.
os: [ubuntu-22.04]
generator: ["Ninja", "Unix Makefiles"]
cxx: ["g++-11", "g++-12", "clang++-15", "clang++-16"]
standard: [17, 20, 23]
build_type: [Debug]
include:
- cxx: g++-11
install: sudo apt install g++-11
- cxx: g++-12
install: sudo apt install g++-12
- cxx: clang++-15
source: "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
install: sudo apt install clang-15
- cxx: clang++-16
source: "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
install: sudo apt install clang-16
# BUG: Ninja + GCC + Modules fails to build
exclude:
- {generator: "Ninja", cxx: "g++-11", standard: 20 }
- {generator: "Ninja", cxx: "g++-11", standard: 23 }
- {generator: "Ninja", cxx: "g++-12", standard: 20 }
- {generator: "Ninja", cxx: "g++-12", standard: 23 }
steps:
- uses: actions/checkout@v3
- name: Create Build Environment
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421 #LLVM repo key
echo '${{matrix.source}}' | sudo tee /etc/apt/sources.list.d/github.list
sudo apt update
sudo apt install ninja-build
${{matrix.install}}
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{matrix.cxx}}
run: cmake -G "${{matrix.generator}}" -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${GITHUB_WORKSPACE}/example
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{matrix.build_type}} --parallel
- name: Test
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_CXX_STANDARD=${{matrix.standard}} -P "${GITHUB_WORKSPACE}/.github/workflows/test_helloworld.cmake"