-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (47 loc) · 1.81 KB
/
run_experiments.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Check for new qiskit versions, run benchmark experiments 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}}
steps:
- name: Setup repository on this workflow
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install and configure Github CLI
uses: cli/cli/setup@v2
with:
gh-version: 2
- name: Install tox
run: pip install tox
- name: Run experiment steps in tox
run: tox -ve py38
- name: Configure Git with Bot Git Config
run: |
git config user.name "${{ secrets.BOT_USERNAME }}"
git config user.email "${{ secrets.BOT_EMAIL }}"
- name: Check for updates on result files and open new PR with Bot user
run: |
untracked_csv_files=$(find ./benchmarking/results/ -name '*.csv' -type f)
deleted_csv_files=$(git diff --name-only HEAD@{1} HEAD | grep -E '^../results/.*\.csv')
if [ -n "$untracked_csv_files" ] || [ -n "deleted_csv_files"]; then
git checkout -b bot-branch
git add $untracked_csv_files
git rm $deleted_csv_files
git commit -m "Add new result files"
git push --set-upstream origin bot-branch
gh pr create --base main --head bot-branch --title "Add new result files"
git checkout main
fi
env:
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
BOT_EMAIL: ${{ secrets.BOT_EMAIL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}