Merge pull request #83 from astropy/dependabot/github_actions/dot-git… #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |