forked from SciTools/iris
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (68 loc) · 2.57 KB
/
benchmark.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
# This is a basic workflow to help you get started with Actions
name: benchmark-check
on:
# Triggers the workflow on push or pull request events but only for the master branch
pull_request:
jobs:
benchmark:
if: "github.repository == 'SciTools/iris'"
runs-on: ubuntu-latest
env:
IRIS_TEST_DATA_LOC_PATH: benchmarks
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
IRIS_TEST_DATA_VERSION: "2.5"
# Lets us manually bump the cache to rebuild
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "2"
PY_VER: 3.8
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Fetch the PR base branch too
run: |
git fetch --depth=1 origin ${{ github.event.pull_request.base.ref }}
git branch _base FETCH_HEAD
echo PR_BASE_SHA=$(git rev-parse _base) >> $GITHUB_ENV
- name: Install Nox
run: |
pip install nox
- name: Cache environment directories
id: cache-env-dir
uses: actions/cache@v2
with:
path: |
.nox
benchmarks/.asv/env
$CONDA/pkgs
key: ${{ runner.os }}-${{ hashFiles('requirements/') }}-${{ env.ENV_CACHE_BUILD }}
- name: Cache test data directory
id: cache-test-data
uses: actions/cache@v2
with:
path: |
${{ env.IRIS_TEST_DATA_PATH }}
key:
test-data-${{ env.IRIS_TEST_DATA_VERSION }}-${{ env.TEST_DATA_CACHE_BUILD }}
- name: Fetch the test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: |
wget --quiet https://github.com/SciTools/iris-test-data/archive/v${IRIS_TEST_DATA_VERSION}.zip -O iris-test-data.zip
unzip -q iris-test-data.zip
mkdir --parents ${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_LOC_PATH}
mv iris-test-data-${IRIS_TEST_DATA_VERSION} ${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}
- name: Set test data var
run: |
echo "OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV
- name: Run CI benchmarks
run: |
mkdir --parents benchmarks/.asv
set -o pipefail
nox --session="benchmarks(ci compare)" | tee benchmarks/.asv/ci_compare.txt
- name: Archive asv results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: asv-report
path: |
benchmarks/.asv/results
benchmarks/.asv/ci_compare.txt