-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (118 loc) · 4.12 KB
/
ci.yml
File metadata and controls
144 lines (118 loc) · 4.12 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
name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
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/master'
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: tests/benchmark/build/msvc-x64/Release
run: ./benchmark-pvm.exe --benchmark_format=json --benchmark_out=result.json
- name: Store results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: googlecpp
output-file-path: tests/benchmark/build/msvc-x64/Release/result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
comment-on-alert: true
alert-threshold: '150%'
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: Check formatting
run: |
find include tests -name "*.h" -o -name "*.cpp" | \
xargs clang-format --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 -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-tidy-19
- name: Check formatting
run: |
find include -name "*.h" -o -name "*.cpp" | \
xargs -I{} clang-tidy-19 {} -- -x c++ -std=c++20 -I include -include cstdint -include cstddef
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"