Skip to content

Publish Benchmarks #728

Publish Benchmarks

Publish Benchmarks #728

Workflow file for this run

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@v4
- 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
mkdir css
cd css
wget https://raw.githubusercontent.com/qutip/qutip.github.io/master/css/bootstrap.css
wget https://raw.githubusercontent.com/qutip/qutip.github.io/master/css/site.css
cd ..
mkdir _includes
cd _includes
wget https://raw.githubusercontent.com/qutip/qutip.github.io/master/_includes/footer.html
wget https://raw.githubusercontent.com/qutip/qutip.github.io/master/_includes/header.html
wget https://raw.githubusercontent.com/qutip/qutip.github.io/master/_includes/navbar.html
cd ..
# 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