-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (102 loc) · 3.48 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
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
name: Build argparse
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: "Windows latest - MSVC",
os: windows-latest,
cc: "cl",
cxx: "cl",
}
- {
name: "Ubuntu 24.04 - GCC",
os: ubuntu-24.04,
cc: "gcc",
cxx: "g++",
}
- {
name: "Ubuntu 24.04 - Clang",
os: ubuntu-24.04,
cc: "clang",
cxx: "clang++",
}
- {
name: "macOS 14",
os: macos-14,
cc: "clang",
cxx: "clang++",
}
steps:
- uses: actions/checkout@v4
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
- name: CMake build
run: cmake --build build --parallel
clangtidy:
name: "clang-tidy"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install clang-tidy
run: |
sudo apt-get 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
sanitisers:
name: "sanitisers"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -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
valgrind:
name: "Valgrind"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Valgrind
run: |
sudo apt-get update
sudo apt install -y valgrind
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
- 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@v4
- name: Install lcov
run: |
sudo apt-get update
sudo apt install -y lcov
- name: CMake configure
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -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 --output-file coverage.info --ignore-errors mismatch
lcov --list coverage.info
lcov --extract coverage.info --output-file argparse.info *argparse.h
lcov --list argparse.info
bash <(curl -s https://codecov.io/bash) -f argparse.info