-
Notifications
You must be signed in to change notification settings - Fork 56
102 lines (90 loc) · 2.88 KB
/
asv-benchmarking.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
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
100
101
102
name: ASV Benchmarking
on:
push:
branches:
- main
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
env:
CONDA_ENV_FILE: ./build_envs/asv-bench.yml
ASV_DIR: ./benchmarks
steps:
- name: Checkout geocat-comp
uses: actions/checkout@v4
with:
repository: NCAR/geocat-comp
fetch-depth: 0
- name: Checkout geocat-comp-asv
uses: actions/checkout@v4
with:
repository: NCAR/geocat-comp-asv
persist-credentials: false
fetch-depth: 0
ref: main
path: geocat-comp-asv
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: "24.1.2-0"
activate-environment: asv-bench
- name: Get date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache environment
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('./build_envs/asv-bench.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if the environment file has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
conda env update -n asv-bench -f
./build_envs/asv-bench.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Conda list
run: |
conda info
conda list
- name: Copy existing results
run: |
if [ -d "geocat-comp-asv/results" ]; then
cp -r geocat-comp-asv/results benchmarks/
fi
- name: Run benchmarks
id: benchmark
run: |
cd benchmarks
asv machine --machine GH-Actions --os ubuntu-latest --arch x64 --cpu "2-core unknown" --ram 7GB
asv run v2023.02.0..main --skip-existing --parallel || true
- name: Commit and push benchmark results
run: |
if [ -d "geocat-comp-asv/results" ]; then
rm -r geocat-comp-asv/results
fi
cp -r benchmarks/results/ geocat-comp-asv/
cd geocat-comp-asv
git config --local user.email "anissaz@ucar.edu"
git config --local user.name "anissa111"
git add results
git commit -m "[🤖] Update benchmark results"
- name: Push to geocat-comp-asv
if: github.ref == 'refs/heads/main' && github.repository == 'NCAR/geocat-comp'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.COMP_ASV_PAT }}
branch: main
force: true
repository: NCAR/geocat-comp-asv
directory: geocat-comp-asv