Nightly Benchmarks #224
This file contains hidden or 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
| name: Nightly Benchmarks | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' # daily at 02:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| run-benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install numpy scipy matplotlib | |
| python -m pip install -e . | |
| - name: Run Python benchmarks | |
| run: | | |
| python scripts/run_benchmarks.py --csv benchmark_results.csv --plot benchmark_results.png | |
| - name: Prepare gh-pages data | |
| run: | | |
| mkdir -p gh-pages-data | |
| TS=$(date -u +"%Y%m%d-%H%M%S") | |
| cp benchmark_results.csv gh-pages-data/results-$TS.csv | |
| cp benchmark_results.png gh-pages-data/results-$TS.png | |
| # Also keep latest copy | |
| cp benchmark_results.csv gh-pages-data/latest.csv | |
| cp benchmark_results.png gh-pages-data/latest.png | |
| - name: Upload benchmark artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: | | |
| benchmark_results.csv | |
| benchmark_results.png | |
| - name: Push to gh-pages branch | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: gh-pages-data | |
| clean: false | |
| target-folder: data/benchmarks |