-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (88 loc) · 2.42 KB
/
Copy pathcpp-program-04.yml
File metadata and controls
94 lines (88 loc) · 2.42 KB
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
name: C++ Program-04
on:
push:
paths:
- 'C++/Program-04/**'
- '.github/workflows/cpp-program-04.yml'
pull_request:
paths:
- 'C++/Program-04/**'
- '.github/workflows/cpp-program-04.yml'
workflow_dispatch:
defaults:
run:
working-directory: 'C++/Program-04'
jobs:
build-test:
name: ${{ matrix.compiler }} / ${{ matrix.preset }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
preset: [dev, release]
include:
- compiler: gcc
cc: gcc-13
cxx: g++-13
- compiler: clang
cc: clang-18
cxx: clang++-18
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
- name: Configure, build and test
run: cmake --workflow --preset ${{ matrix.preset }}
sanitizers:
name: ASan + UBSan
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
# Make UBSan findings fail the run instead of merely printing.
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
ASAN_OPTIONS: detect_leaks=1
steps:
- uses: actions/checkout@v4
- name: Configure, build and test under sanitizers
run: cmake --workflow --preset asan
coverage:
name: Coverage
runs-on: ubuntu-24.04
env:
CC: gcc-13
CXX: g++-13
steps:
- uses: actions/checkout@v4
- name: Install gcovr
run: pipx install gcovr
- name: Configure and build
run: |
cmake --preset coverage
cmake --build build/coverage -j"$(nproc)"
- name: Generate coverage report
run: cmake --build build/coverage --target coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: 'C++/Program-04/build/coverage/coverage/'
if-no-files-found: error
lint:
name: clang-format + clang-tidy
runs-on: ubuntu-24.04
env:
CC: clang-18
CXX: clang++-18
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: |
clang-format-18 --dry-run --Werror \
src/*.cpp app/*.cpp include/myproject/*.h tests/*.cpp
- name: Run clang-tidy
run: |
cmake --preset tidy -DCLANG_TIDY_EXECUTABLE="$(command -v clang-tidy-18)"
cmake --build build/tidy -j"$(nproc)"