Publish Benchmarks #296
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
name: Publish Benchmarks | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Nightly Benchmarks"] | |
types: ["completed"] | |
branches: ["master"] | |
defaults: | |
run: | |
# The slightly odd shell call is to force bash to read .bashrc, which is | |
# necessary for having conda behave sensibly. We use bash as the shell even | |
# on Windows, since we don't run anything complicated, and it makes | |
# things much simpler. | |
shell: bash -l {0} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
# if: ${{ github.repository == 'qutip/qutip-benchmark' && github.ref == 'refs/heads/master' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: actions-bench | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
- name: Install dependencies | |
run: | | |
mamba install pandas matplotlib | |
- name: Download benchmark data from S3 | |
run: | | |
aws s3 cp s3://qutip-benchmark-data/nightly ./.benchmarks --recursive | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.QUTIP_BENCHMARK_S3_KEYID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.QUTIP_BENCHMARK_S3_SECRET }} | |
AWS_EC2_METADATA_DISABLED: true | |
- name: Generate benchmark plots | |
run: | | |
python -m qutip_benchmark.cli.view_benchmarks --nightly --plotpath website/plots/nightly | |
python -m qutip_benchmark.cli.view_benchmarks --scaling --plotpath website/plots/scaling | |
- name: Build website with Jekyll | |
run: | | |
sudo gem install bundler jekyll | |
sudo apt-get install subversion | |
cd website | |
# Download resources from qutip.github.io repository | |
svn export https://github.com/qutip/qutip.github.io/trunk/css | |
svn export https://github.com/qutip/qutip.github.io/trunk/_includes | |
svn export https://github.com/qutip/qutip.github.io/trunk/header_source | |
svn export https://github.com/qutip/qutip.github.io/trunk/images | |
# Add additional includes | |
cp -r _includes_extra/* _includes | |
# build the website | |
bundle config path .gems | |
bundle install | |
bundle exec jekyll build | |
- name: Publish benchmarks | |
run: | | |
python -m pip install ghp-import | |
ghp-import -m "Automatic push by ghp-import" -f -n -p -o -r origin -b gh-pages website/_site |