-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (64 loc) · 2.05 KB
/
asv-main.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
# This workflow will run benchmarks with airspeed velocity (asv),
# store the new results in the "benchmarks" branch and publish them
# to a dashboard on GH Pages.
name: Run ASV benchmarks for main
on:
push:
branches: [ main ]
env:
PYTHON_VERSION: "3.10"
ASV_VERSION: "0.6.4"
WORKING_DIR: ${{github.workspace}}/benchmarks
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
asv-main:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: ${{env.WORKING_DIR}}
steps:
- name: Set up Python ${{env.PYTHON_VERSION}}
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Checkout main branch of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}"
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes
- name: Fetch previous results from the "benchmarks" branch
run: |
if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
git merge origin/benchmarks \
--allow-unrelated-histories \
--no-commit
mv ../_results .
fi
- name: Run ASV for the main branch
run: asv run ALL --skip-existing --verbose || true
- name: Submit new results to the "benchmarks" branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: benchmarks
folder: ${{env.WORKING_DIR}}/_results
target-folder: _results
- name: Generate dashboard HTML
run: |
asv show
asv publish
- name: Deploy to Github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ${{env.WORKING_DIR}}/_html