-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (83 loc) · 3.1 KB
/
benchmark.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Benchmarks
on:
push:
branches:
- main
schedule:
- cron: "0 5 * * 4"
# Sets permissions of the GITHUB_TOKEN to allow writing back to `master`
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# Cancel in-progress deployment jobs so only the latest one succeeds.
concurrency:
group: "pages"
cancel-in-progress: true
env:
RUNNER_NAME: gcp-n1-standard-8
jobs:
run-benchmarks:
runs-on: "cirun-benchmark-runner--${{ github.run_id }}"
steps:
# Install git first; otherwise actions/checkout silently falls back
# to github REST API for downloading the repo
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install git zlib1g-dev build-essential pkg-config rsync -y
- uses: actions/checkout@v4
with:
repository: deshaw/versioned-hdf5
path: ./versioned-hdf5/
fetch-depth: 0 # Needed for asv to be able to reference HEAD^
- uses: actions/checkout@v4
with:
path: ./versioned-hdf5-benchmarks/
- name: Setup python with miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
channels: conda-forge
- name: Install versioned-hdf5
working-directory: ./versioned-hdf5
run: |
echo "PROJECT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
conda install -n test pip hdf5 openmpi h5py ndindex -c conda-forge -y
conda run -n test pip install '.[bench]'
# Compare the most recent commit with the previous one
- name: Run benchmarks
working-directory: ./versioned-hdf5
run: |
# set the machine name depending on the OS/arch image
echo "Setting machine name to $RUNNER_NAME"
conda run -n test asv machine --machine $RUNNER_NAME --yes
cat ~/.asv-machine.json
# Don't return exit code 1 if results are slower
conda run -n test asv continuous HEAD^ HEAD || true;
- name: Copy benchmarks to versioned-hdf5-benchmarks
run: |
ls -lash ./versioned-hdf5-benchmarks/.asv || true
rsync -R ./versioned-hdf5/.asv ./versioned-hdf5-benchmarks/
ls -lash ./versioned-hdf5-benchmarks
ls -lash ./versioned-hdf5-benchmarks/.asv
- name: Add and commit benchmarks
uses: EndBug/add-and-commit@v9
with:
cwd: ./versioned-hdf5-benchmarks
add: .asv/
message: "Update benchmarks for commit ${{ env.PROJECT_SHA }}"
- name: Generate html
working-directory: ./versioned-hdf5-benchmarks
run: |
conda run -n test asv publish --config ../versioned-hdf5/asv.conf.json -o ./html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './versioned-hdf5-benchmarks/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4