-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (122 loc) · 4.45 KB
/
ci.yml
File metadata and controls
150 lines (122 loc) · 4.45 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Build argparse
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-15, ubuntu-24.04, windows-latest]
type: [Debug, Release]
compiler: [cl, clang++, g++-14]
exclude:
- os: macos-15
compiler: cl
- os: macos-15
compiler: clang++
- os: ubuntu-24.04
compiler: cl
- os: windows-latest
compiler: clang++
- os: windows-latest
compiler: g++-14
steps:
- uses: actions/checkout@v6
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
- name: CMake build
if: runner.os == 'macOS'
run: cmake --build build
- name: CMake build
if: runner.os != 'macOS'
run: cmake --build build --parallel
clangtidy:
if: false # disable as it takes way too much time
name: "clang-tidy"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install clang-tidy
run: |
sudo apt update
sudo apt install -y clang-tidy
- name: CMake configure
run: cmake -Bbuild -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-checks=-*,clang-analyzer-*,modernize-*;-warnings-as-errors=*"
- name: CMake build
run: cmake --build build --parallel
clang-sanitisers:
name: "clang-sanitisers"
runs-on: ubuntu-24.04
strategy:
matrix:
type: [Debug, Release]
steps:
- uses: actions/checkout@v6
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-fsanitize=address,undefined,alignment,array-bounds -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined,alignment,array-bounds
- name: CMake build
run: cmake --build build --parallel --target run-unit-test
gcc-sanitisers:
name: "gcc-sanitisers"
runs-on: ubuntu-24.04
strategy:
matrix:
type: [Debug, Release]
steps:
- uses: actions/checkout@v6
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS=-fsanitize=address,undefined,leak -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address,undefined,leak
- name: CMake build
run: cmake --build build --parallel --target run-unit-test
msvc-sanitisers:
name: "msvc-sanitisers"
runs-on: windows-latest
strategy:
matrix:
type: [Debug, Release]
steps:
- uses: actions/checkout@v6
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_CXX_FLAGS="/fsanitize=address /EHsc"
- name: CMake build
run: cmake --build build --parallel --target run-unit-test
valgrind:
name: "Valgrind"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Valgrind
run: |
sudo apt update
sudo apt install -y valgrind
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
- name: CMake build
run: cmake --build build --parallel --target unittest
- name: Run Valgrind
run: valgrind ./build/test/unittest/unittest
coverage:
name: "Coverage"
runs-on: ubuntu-24.04
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Install lcov
run: |
sudo apt update
sudo apt install -y lcov
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage
- name: CMake build
run: cmake --build build --parallel --target run-unit-test
- name: Generate coverage
run: |
lcov --directory build --capture --gcov-tool gcov-14 --output-file coverage.info --ignore-errors mismatch
lcov --list coverage.info
lcov --extract coverage.info --output-file argparse.info *argparse.hpp
lcov --list argparse.info
bash <(curl -s https://codecov.io/bash) -f argparse.info