-
-
Notifications
You must be signed in to change notification settings - Fork 13
75 lines (68 loc) · 2.59 KB
/
run-benchmarks.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run benchmarks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
matrix:
astropy-version: [4.1.*]
python-version: [3.7]
numpy-version: [1.17.4]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install "numpy==$NUMPY_VERSION"
python -m pip install "astropy==$ASTROPY_VERSION"
# Non declared build dependencies
python -m pip install Cython
# Tools to benchmark
python -m pip install -r requirements.txt
# Prefetch as workaround for https://github.com/skyfielders/python-skyfield/issues/262
wget -c "$(python -c 'from coordinates_benchmark.tools.skyfield import EPHEMERIS; print(EPHEMERIS)')"
env:
NUMPY_VERSION: ${{ matrix.numpy-version }}
ASTROPY_VERSION: ${{ matrix.astropy-version }}
- name: Run benchmarks
run: |
./make.py --help
./make.py tool-info
./make.py make_observer_table
./make.py make_skycoord_table
./make.py benchmark-celestial
./make.py benchmark-horizontal
./make.py summary-celestial
# Making all plots is slow, but this is run rarely enough that it's fine to just do them all. However,
# if you are debugging, you could instead add the --tools=astropy flag to generate just some of the
# plots.
./make.py plots
- name: Archive code coverage results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: benchmark-results
path: output/
deploy:
runs-on: ubuntu-latest
needs: [benchmark]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Download results
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: benchmark-results
path: output
- name: Deploy results
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # v4.6.8
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: output