-
Notifications
You must be signed in to change notification settings - Fork 86
71 lines (65 loc) · 2.36 KB
/
notebook-test-cron.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
59
60
61
62
63
64
65
66
67
68
69
70
71
# This code is a Qiskit project.
#
# (C) Copyright IBM 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
name: Test notebooks that submit jobs
on:
schedule:
- cron: "0 7 1,15 * *" # At 07:00 on day-of-month 1 and 15.
workflow_dispatch:
jobs:
execute:
name: Execute notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/set-up-notebook-testing
with:
ibm-quantum-token: ${{ secrets.IBM_QUANTUM_TEST_TOKEN }}
instance: "client-enablement/documentation/qiskit-documenta"
- name: Execute notebooks
timeout-minutes: 350
run: tox -- --write --only-submit-jobs
- name: Detect changed notebooks
id: changed-notebooks
if: "!cancelled()"
run: |
echo "CHANGED_NOTEBOOKS<<EOF" >> $GITHUB_OUTPUT
git diff --name-only >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Upload executed notebooks
if: "!cancelled()"
uses: actions/upload-artifact@v4
with:
name: Executed notebooks
path: ${{ steps.changed-notebooks.outputs.CHANGED_NOTEBOOKS }}
make_issue:
name: Make issue on failure
needs: [execute]
if: ${{ failure() && github.event_name == 'schedule' }}
runs-on: ubuntu-latest
steps:
- name: Post issue
uses: actions/github-script@v7
with:
script: |
const message = `Today's scheduled test of notebooks that submit jobs failed.
Please [check the logs](https://github.com/Qiskit/documentation/actions/runs/${{ github.run_id }}/).
> [!NOTE]
> This issue was created by a GitHub action.
`
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Weekly notebook test failed",
body: message,
assignees: ["frankharkins", "javabster", "kevinsung",]
})