-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 2.22 KB
/
benchmark.yml
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
name: Benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
benchmark:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Run matrix benchmark
run: ${{github.workspace}}/build/benchmark_matrix --benchmark_format=json --benchmark_out=matrix_benchmark_result.json
- name: Run vector benchmark
run: ${{github.workspace}}/build/benchmark_vector --benchmark_format=json --benchmark_out=vector_benchmark_result.json
- name: Store matrix benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Matrix Benchmark
tool: 'googlecpp'
output-file-path: matrix_benchmark_result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
- name: Store vector benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Vector Benchmark
tool: 'googlecpp'
output-file-path: vector_benchmark_result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
- name: Copy latest benchmark results
run: |
mkdir -p ./public/dev/bench
cp matrix_benchmark_result.json ./public/dev/bench/latest-matrix-result.json
cp vector_benchmark_result.json ./public/dev/bench/latest-vector-result.json
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: dev/bench