-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (91 loc) · 2.78 KB
/
CI_ubuntu.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
permissions:
actions: write
contents: read
'on':
pull_request:
push:
branches:
- master
env:
UBSAN_OPTIONS: print_stacktrace=1
jobs:
build_and_test:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'NO_PIPELINE') }}
strategy:
fail-fast: false
matrix:
include:
- type: debug
compiler: clang
version: 17
- type: debug
compiler: clang
version: 19
- type: debug
compiler: gcc
version: 12
- type: debug
compiler: gcc
version: 14
- type: release
compiler: clang
version: 17
- type: release
compiler: clang
version: 19
- type: release
compiler: gcc
version: 12
- type: release
compiler: gcc
version: 14
name: ubuntu-24.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}}
runs-on: ubuntu-24.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
- name: Checkout the code
uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt install ccache
sudo apt install cmake
sudo apt install lld
sudo apt install ninja-build
sudo apt install build-essential
sudo make -f scripts/ci_ubuntu.make install-compiler compiler=${{matrix.compiler}} version=${{matrix.version}}
- name: ccache activate logs
if: ${{runner.debug}}
run: |
echo "CCACHE_LOGFILE=/home/$(whoami)/ccache.log" >> $GITHUB_ENV
- name: Setup ccache
run: |
ccache -M 2.0GB
- name: Reuse ccache directory
uses: actions/cache@v2
with:
path: ~/.cache/ccache
key: 'ubuntu-24.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache-dir ${{github.ref}}'
restore-keys: |
ubuntu-24.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache-dir ${{github.ref}}
ubuntu-24.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache-
- name: Configure cmake project
run: |
cp scripts/presets_ubuntu-24.04.json CMakePresets.json
cmake --preset ${{matrix.compiler}}_${{matrix.version}}_${{matrix.type}}
- name: Build project
run: >
cmake
--build cmake_build
--target all
- name: ccache stats after build
run: |
ccache -s
- name: ccache more logs
if: ${{runner.debug}}
run: |
cat ~/ccache.log
- name: Run tests
run: |
cd cmake_build && sudo ctest --output-on-failure