Skip to content

Run benchmark experiments on new Qiskit versions and submit results to Metriq.info #7

Run benchmark experiments on new Qiskit versions and submit results to Metriq.info

Run benchmark experiments on new Qiskit versions and submit results to Metriq.info #7

name: Run benchmark experiments on new Qiskit versions and submit results to Metriq.info
on:
schedule:
- cron: '0 0 1 * *' # Schedule to run on the 1st day of each month at 12:00 AM UTC
env:
FORCE_COLOR: true
jobs:
run_experiment_steps:
runs-on: ubuntu-latest
env:
METRIQ_TOKEN: ${{ secrets.METRIQ_TOKEN}}
BOT_ACCESS_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install tox
run: pip install tox
- name: Run experiments in tox
run: tox -ve py311
- name: Check for new artifacts
run: |
cd benchmarking/results
if git status --porcelain | grep -E "\.csv$" -q; then
echo "New result files found"
echo "changed_csv_files=1" >> $GITHUB_ENV
NEW_BRANCH="automated-branch"
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV
else
echo "No result files to process"
echo "changed_csv_files=0" >> $GITHUB_ENV
fi
cd ../../
- name: Create Pull Request for new artifacts
if: env.changed_csv_files == '1'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
commit-message: Update results
title: Update results
base: main
branch: ${{ env.NEW_BRANCH }}
delete-branch: true