Skip to content

Merge pull request #79 from pllim/action-ver-hash #32

Merge pull request #79 from pllim/action-ver-hash

Merge pull request #79 from pllim/action-ver-hash #32

# 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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
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@4bcb0dacb6b13c279e55b2a8cd3ddd6271611a09 # v4.6.5
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: output