Repository navigation
140 lines (129 loc) · 3.96 KB
/
Copy pathci.yml
File metadata and controls
140 lines (129 loc) · 3.96 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
name: ci
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DHH_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
# Every GCC and Clang of the runner image, without -Werror: newer compilers may add warnings.
compilers:
strategy:
fail-fast: false
matrix:
include:
- { cc: gcc-12, cxx: g++-12 }
- { cc: gcc-13, cxx: g++-13 }
- { cc: gcc-14, cxx: g++-14 }
- { cc: clang-16, cxx: clang++-16 }
- { cc: clang-17, cxx: clang++-17 }
- { cc: clang-18, cxx: clang++-18 }
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
# The library is C++17; it must also build and pass as C++20 and C++23.
standards:
strategy:
fail-fast: false
matrix:
std: ["17", "20", "23"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: >
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{ matrix.std }}
-DHH_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -S . -B build
- name: Build
run: cmake --build build --config Release --parallel
- name: Test
run: ctest --test-dir build -C Release --output-on-failure
clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DHH_WARNINGS_AS_ERRORS=ON -DHH_BUILD_LAB=ON
env:
CXX: clang++
CC: clang
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
sanitizers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake --preset asan-ubsan
- name: Build
run: cmake --build --preset asan-ubsan --parallel
- name: Test
run: ctest --preset asan-ubsan
shared:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DHH_WARNINGS_AS_ERRORS=ON
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Only the public API is exported
run: |
if nm -DC --defined-only build/libhh.so | grep -q 'hh::detail'; then
echo "internal symbols are exported"; exit 1
fi
consumers:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: find_package, pkg-config and add_subdirectory
run: tests/consumer/run.sh
lab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Configure
run: cmake --preset lab
- name: Build
run: cmake --build --preset lab --parallel
- name: Self-test
run: ./build/lab/tools/lab/hh_lab selftest --out build/lab-out