Repository navigation
178 lines (151 loc) · 5.68 KB
/
Copy pathtest-cpp.yaml
File metadata and controls
178 lines (151 loc) · 5.68 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: test-cpp
permissions: {}
on:
push:
branches:
- main
- renovate/**
paths:
- cpp/**
- testdata/**
- .github/**
pull_request:
paths:
- cpp/**
- testdata/**
- .github/**
jobs:
test-cpp-system-packages-linux:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-24.04, cxx: g++, version: 12 }
- { os: ubuntu-24.04, cxx: g++, version: 13 }
- { os: ubuntu-24.04, cxx: clang++, version: 16 }
- { os: ubuntu-24.04, cxx: clang++, version: 17 }
- { os: ubuntu-26.04, cxx: g++, version: 14 }
- { os: ubuntu-26.04, cxx: g++, version: 15 }
- { os: ubuntu-26.04, cxx: clang++, version: 21 }
- { os: ubuntu-26.04, cxx: clang++, version: 22 }
env:
CXX: ${{ matrix.config.cxx }}-${{ matrix.config.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@dbeefd73e8e2ffc1bbc412570072735eb4db3607 # v1.2.25
with:
key: ${{ github.job }}-${{ matrix.config.os }}-${{ matrix.config.cxx }}-${{ matrix.config.version }}-${{ github.ref }}
append-timestamp: false
save: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y nlohmann-json3-dev libgtest-dev libgmock-dev libyaml-cpp-dev
# Ubuntu 24.04 ships fmt 9; newer runners provide fmt 10+ via apt.
- name: Install libfmt (apt)
if: matrix.config.os != 'ubuntu-24.04'
run: sudo apt-get install -y libfmt-dev
- name: Checkout libfmt
if: matrix.config.os == 'ubuntu-24.04'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fmtlib/fmt
ref: 10.2.1
path: fmt-src
persist-credentials: false
- name: Install libfmt (from source)
if: matrix.config.os == 'ubuntu-24.04'
run: |
cmake -S fmt-src -B fmt-src/build \
-DCMAKE_BUILD_TYPE=Release \
-DFMT_TEST=OFF -DFMT_DOC=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
cmake --build fmt-src/build
sudo cmake --install fmt-src/build
- name: Build and unit test
run: cmake --workflow --preset test-system
test-cpp-system-packages-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@dbeefd73e8e2ffc1bbc412570072735eb4db3607 # v1.2.25
with:
key: ${{ github.job }}-${{ github.ref }}
append-timestamp: false
save: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: brew install googletest nlohmann-json yaml-cpp fmt
- name: Build and unit test
run: cmake --workflow --preset test-system
test-cpp-system-packages-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- name: Install build tools
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Install dependencies
shell: pwsh
run: |
vcpkg install gtest nlohmann-json yaml-cpp fmt --triplet x64-windows
# Expose the vcpkg toolchain so find_package() locates the packages.
echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV
- name: Build and unit test
run: cmake --workflow --preset test-system
test-cpp-coverage:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.15'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y nlohmann-json3-dev libgtest-dev libgmock-dev libyaml-cpp-dev libfmt-dev
python -m pip install gcovr==8.6
- name: ccache
uses: hendrikmuhs/ccache-action@dbeefd73e8e2ffc1bbc412570072735eb4db3607 # v1.2.25
with:
key: ${{ github.job }}-${{ github.ref }}
append-timestamp: false
save: ${{ github.ref == 'refs/heads/main' }}
- name: Coverage
run: cmake --workflow --preset coverage
- name: Show coverage summary
run: cat build/coverage/coverage-summary.md
test-cpp-lint:
runs-on: ubuntu-26.04
env:
CXX: clang++
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang clang-tidy nlohmann-json3-dev libgtest-dev libgmock-dev libyaml-cpp-dev libfmt-dev
- name: ccache
uses: hendrikmuhs/ccache-action@dbeefd73e8e2ffc1bbc412570072735eb4db3607 # v1.2.25
with:
key: ${{ github.job }}-${{ github.ref }}
append-timestamp: false
save: ${{ github.ref == 'refs/heads/main' }}
- name: Lint
run: cmake --workflow --preset tidy