-
Notifications
You must be signed in to change notification settings - Fork 58
64 lines (63 loc) · 2.25 KB
/
bench-deploy.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
name: GPU benchmark on `main`
on:
push:
branches:
- main
jobs:
# TODO: Account for different `justfile` and `bench.env` files
# One option is to upload them to gh-pages for qualitative comparison
# TODO: Fall back to a default if `justfile`/`bench.env` not present
benchmark:
name: Bench and deploy
runs-on: [self-hosted, gpu-bench, gh-pages]
steps:
# Install deps
- uses: actions/checkout@v4
with:
repository: argumentcomputer/ci-workflows
- uses: ./.github/actions/gpu-setup
with:
gpu-framework: 'cuda'
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
# Run benchmarks and deploy
- name: Get old benchmarks
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- run: mkdir -p target; cp -r gh-pages/benchmarks/criterion target;
- name: Install criterion
run: cargo install cargo-criterion
- name: Run benchmarks
run: |
just gpu-bench-ci fibonacci
cp fibonacci-${{ github.sha }}.json ..
working-directory: ${{ github.workspace }}/benches
# TODO: Prettify labels for easier viewing
# Compress the benchmark file and metadata for later analysis
- name: Compress artifacts
run: |
echo $LABELS > labels.md
tar -cvzf fibonacci-${{ github.sha }}.tar.gz Cargo.lock fibonacci-${{ github.sha }}.json labels.md
working-directory: ${{ github.workspace }}
- name: Deploy latest benchmark report
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/criterion
destination_dir: benchmarks/criterion
- name: Copy benchmark json to history
run: mkdir history; cp fibonacci-${{ github.sha }}.tar.gz history/
- name: Deploy benchmark history
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: history/
destination_dir: benchmarks/history
keep_files: true