Skip to content

Commit 1f0da6d

Browse files
Merge pull request #2 from nevergiveupcpp/ngu/ci
chore: add benchmark tracking to CI
2 parents a55abe7 + 76c78d8 commit 1f0da6d

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @nevergiveupcpp

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,41 @@ jobs:
6767
- name: Test
6868
working-directory: tests/unittest/build/${{ matrix.preset }}
6969
run: ctest --build-config Release --output-on-failure
70+
71+
benchmark:
72+
name: Benchmark
73+
runs-on: windows-latest
74+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
75+
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- name: Set VCPKG_ROOT
80+
shell: bash
81+
run: echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
82+
83+
- name: Install Google Benchmark
84+
run: vcpkg install benchmark:x64-windows
85+
86+
- name: Configure
87+
working-directory: tests/benchmark
88+
run: cmake --preset msvc-x64
89+
90+
- name: Build
91+
working-directory: tests/benchmark
92+
run: cmake --build --preset msvc-x64 --config Release
93+
94+
- name: Run
95+
working-directory: tests/benchmark/build/msvc-x64/Release
96+
run: ./benchmark-pvm.exe --benchmark_format=json --benchmark_out=result.json
97+
98+
- name: Store results
99+
uses: benchmark-action/github-action-benchmark@v1
100+
with:
101+
tool: googlecpp
102+
output-file-path: tests/benchmark/build/msvc-x64/Release/result.json
103+
github-token: ${{ secrets.GITHUB_TOKEN }}
104+
auto-push: true
105+
comment-on-alert: true
106+
alert-threshold: '150%'
107+
fail-on-alert: true

0 commit comments

Comments
 (0)