-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (70 loc) · 2.76 KB
/
ci.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: C++ CI
on:
push:
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
jobs:
build-and-test-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build gcc g++ libfmt-dev
- name: Configure CMake with gcc
run: cmake -B ${{github.workspace}}/build/gcc -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_CXX_COMPILER=g++
- name: Build with gcc
run: cmake --build ${{github.workspace}}/build/gcc
- name: Test with gcc
working-directory: ${{github.workspace}}/build/gcc
run: ctest
build-and-test-clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add LLVM Repository
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang-17 libfmt-dev libc++-17-dev libc++abi-17-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
- name: Configure Clang-17 as the default compiler
run: |
echo "CC=clang-17" >> $GITHUB_ENV
echo "CXX=clang++-17" >> $GITHUB_ENV
clang --version
clang++ --version
- name: Configure CMake with clang++-17 llvm libc++
run: cmake -B ${{github.workspace}}/build/clang-17-libcxx -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_CXX_FLAGS="-stdlib=libc++"
- name: Build with clang++-17 llvm libc++
run: cmake --build ${{github.workspace}}/build/clang-17-libcxx
- name: Test with clang++-17 llvm libc++
working-directory: ${{github.workspace}}/build/clang-17-libcxx
run: ctest
- name: Configure CMake with clang++-17 gnu libstdc++
run: cmake -B ${{github.workspace}}/build/clang-17 -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_CXX_COMPILER=clang++-17
- name: Build with clang++-17
run: cmake --build ${{github.workspace}}/build/clang-17
- name: Test with clang++-17
working-directory: ${{github.workspace}}/build/clang-17
run: ctest
build-and-test-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake with MSVC
run: cmake -B ${{github.workspace}}/build/msvc -DCMAKE_BUILD_TYPE=Debug
- name: Build with MSVC
run: cmake --build ${{github.workspace}}/build/msvc
- name: Test with MSVC
working-directory: ${{github.workspace}}/build/msvc
run: ctest -C Debug