-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (61 loc) · 2.4 KB
/
linux_clang.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
name: Linux Clang
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build_with_clang:
strategy:
matrix:
mode: [ Release, Debug ]
runs-on: [ ubuntu-22.04 ]
steps:
- uses: actions/checkout@v3
- name: Install LLVM16
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt-get install clang-tools-16
- name: Use LLVM16
run: |
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-16 100
sudo update-alternatives --config cc
- name: Check LLVM
run: |
clang --version
- name: Check CMake
run: |
cmake --version
- name: deps
run: |
sudo apt-get install -y build-essential
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
- name: Clone Deps
run: git submodule update --init
working-directory: ${{github.workspace}}
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: "1.11.1"
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{ matrix.mode}}
- name: Configure CMake
run: CXX=clang++-16 CC=clang-16 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.mode}} -G Ninja -DUSE_CCACHE=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}} -j --verbose
- name: Test
working-directory: ${{github.workspace}}/build/test
run: ctest -C ${{matrix.mode}} --output-on-failure
- name: Configure CMake with C++20 Modules
run: CXX=clang++-16 CC=clang-16 cmake -B ${{github.workspace}}/build2 -DCMAKE_BUILD_TYPE=${{matrix.mode}} -G Ninja -DUSE_CCACHE=ON -DPSCM_USE_CXX20_MODULES=ON
- name: Build
run: cmake --build ${{github.workspace}}/build2 --config ${{matrix.mode}} -j --verbose
- name: Test
working-directory: ${{github.workspace}}/build2/test
run: ctest -C ${{matrix.mode}} --output-on-failure