-
Notifications
You must be signed in to change notification settings - Fork 4
75 lines (72 loc) · 2.19 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
72
73
74
75
name: Benchmarks
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.75.0
jobs:
benchmarks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4 # v4
- name: Cache sample slide
id: cache-slide
uses: actions/cache@v4
with:
path: tests/data/
key: slides-test
- name: Cache SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: /tmp/sdk/
key: cache-sdk
- name: Google Storage authentication
if: ${{ steps.cache-slide.outputs.cache-hit != 'true' || steps.cache-sdk.outputs.cache-hit != 'true' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
if: ${{ steps.cache-slide.outputs.cache-hit != 'true' || steps.cache-sdk.outputs.cache-hit != 'true' }}
- name: Download sample tests data
if: steps.cache-slide.outputs.cache-hit != 'true'
run: make dl-test-images
- name: Download dependencies
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: make dl-sdk
- name: Install dependencies
run: make install-deps
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
key: ubuntu-benchmark
- name: Run cargo bench
run: cargo bench --workspace | tee bench-output.txt
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: philips-isyntax-rs Benchmark
tool: 'cargo'
save-data-file: ${{ github.event_name == 'push' }}
output-file-path: bench-output.txt
benchmark-data-dir-path: '.'
max-items-in-chart: 30
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.event_name == 'push' }}
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: true
comment-always: true
alert-comment-cc-users: '@AzHicham'