Skip to content

Run notebooks that submit jobs in cron job #2

Run notebooks that submit jobs in cron job

Run notebooks that submit jobs in cron job #2

# 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 0 1,15 * *" # At 00:00 on day-of-month 1 and 15.
workflow_dispatch:
pull_request:
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: "ibm-q-internal/deployed/default"
- name: Execute notebooks
run: tox -- --only-submit-jobs
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",]
})