-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 2.26 KB
/
bench-branch.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
on:
push:
branches:
- "master"
tags:
- "*"
pull_request:
name: benchmark
jobs:
runBenchmark:
name: run benchmark
runs-on: ubuntu-latest
if: "!startsWith(github.head_ref, 'dependabot/')"
steps:
- name: Check out base
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ssh-key: ${{secrets.API_KEY}}
repo: ${{github.event.pull_request.base.repo.full_name}}
ref: ${{github.event.pull_request.base.ref}}
- name: Run benchmarks on base for comparison
if: github.event_name == 'pull_request'
run: cargo bench --features internal-bench
- name: Check out head
uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ssh-key: ${{secrets.API_KEY}}
repo: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.event.pull_request.head.ref}}
- name: Check out head
uses: actions/checkout@v3
if: github.event_name == 'push'
with:
ssh-key: ${{secrets.API_KEY}}
- name: Run benchmarks
run: cargo bench --features internal-bench
- name: Clone site repo
uses: actions/checkout@v2
with:
ssh-key: ${{secrets.API_KEY}}
path: ..site-repo
ref: gh-pages
- name: Delete previous output
run: test ! -d bench-report/${{github.ref_type}}/${{github.ref_name}} || rm -r bench-report/${{github.ref_type}}/${{github.ref_name}}
working-directory: ..site-repo
- name: Copy artifact to site repo
run: mkdir -p ..site-repo/bench-report/${{github.ref_type}}/${{github.ref_name}}; cp -rT target/criterion ..site-repo/bench-report/${{github.ref_type}}/${{github.ref_name}}
- name: Set Git author
run: git config --global user.name "github-actions[bot]" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Git commit
run: git add bench-report/${{github.ref_type}}/${{github.ref_name}} && git commit --allow-empty -m "Docs build for SOF3/dynec@${{github.sha}}"
working-directory: ..site-repo
- name: Push pages
run: git push --force
working-directory: ..site-repo