-
Notifications
You must be signed in to change notification settings - Fork 9
155 lines (129 loc) · 4.32 KB
/
Copy pathci.yml
File metadata and controls
155 lines (129 loc) · 4.32 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
unittests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
include:
- name: Windows x64 / MSVC
os: windows-latest
preset: msvc-x64
vcpkg_triplet: x64-windows
- name: Windows x64 / Clang
os: windows-latest
preset: llvm-x64
vcpkg_triplet: x64-windows
- name: Windows ARM64 / MSVC
os: windows-11-arm
preset: msvc-arm64
vcpkg_triplet: arm64-windows
- name: Linux x64 / GCC
os: ubuntu-latest
preset: gcc-linux-x64
vcpkg_triplet: x64-linux-dynamic
- name: Linux ARM64 / GCC
os: ubuntu-24.04-arm
preset: gcc-linux-arm64
vcpkg_triplet: arm64-linux
- name: macOS ARM64 / AppleClang
os: macos-latest
preset: apple-clang-macos-arm64
vcpkg_triplet: arm64-osx
steps:
- uses: actions/checkout@v4
- name: Set VCPKG_ROOT
shell: bash
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
- name: Install GTest
run: vcpkg install gtest:${{ matrix.vcpkg_triplet }}
- name: Configure
working-directory: tests/unittest
run: cmake --preset ${{ matrix.preset }}
- name: Build
working-directory: tests/unittest
run: cmake --build --preset ${{ matrix.preset }} --config Release
- name: Test
working-directory: tests/unittest/build/${{ matrix.preset }}
run: ctest --build-config Release --output-on-failure
benchmark:
name: Benchmark
runs-on: windows-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
BENCHMARK_BIN_DIR: tests/benchmark/build/msvc-x64/Release
steps:
- uses: actions/checkout@v4
- name: Set VCPKG_ROOT
shell: bash
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
- name: Install Google Benchmark
run: vcpkg install benchmark:x64-windows
- name: Configure
working-directory: tests/benchmark
run: cmake --preset msvc-x64
- name: Build
working-directory: tests/benchmark
run: cmake --build --preset msvc-x64 --config Release
- name: Run
working-directory: ${{ env.BENCHMARK_BIN_DIR }}
run: ./benchmark-obfuscxx.exe --benchmark_filter="BM_.*_(Low|Medium|High)" --benchmark_format=json --benchmark_out=result.json
- name: Store
uses: benchmark-action/github-action-benchmark@v1
with:
name: Benchmark
tool: googlecpp
output-file-path: ${{ env.BENCHMARK_BIN_DIR }}/result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
comment-on-alert: false
alert-threshold: '200%'
fail-on-alert: true
clang-format:
name: Clang Format
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install Clang-Format 22
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 22
sudo apt-get update
sudo apt-get install -y clang-format-22
- name: Check formatting
run: |
find include \( -name "*.h" -o -name "*.cpp" \) | \
xargs clang-format-22 --dry-run --Werror
clang-tidy:
name: Clang Tidy
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install Clang-Tidy 19
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo apt-get update
sudo apt-get install -y clang-tidy-19
- name: Check tidy
run: |
find include \( -name "*.h" -o -name "*.cpp" \) | \
xargs -I{} clang-tidy-19 {} --header-filter="include/.*" -- -x c++ -std=c++20 -I include
all-checks:
name: All Checks
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [unittests, clang-format, clang-tidy]
steps:
- run: echo "All checks passed"