-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (51 loc) · 1.55 KB
/
Copy pathbenchmarks.yml
File metadata and controls
59 lines (51 loc) · 1.55 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
name: Update VB6Parse Benchmarks
on:
push:
branches: [master]
paths:
- 'projects/vb6parse/src/**'
- 'projects/vb6parse/benches/**'
- 'projects/vb6parse/scripts/generate-benchmarks.py'
- 'Cargo.toml'
- 'Cargo.lock'
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
permissions:
contents: write
jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Generate benchmarks
run: python3 projects/vb6parse/scripts/generate-benchmarks.py
- name: Commit and push if changed
run: |
git pull --rebase --autostash
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/vb6parse/assets/data/benchmarks.json docs/vb6parse/assets/data/benchmarks-history.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update benchmark data"
git push
fi