Skip to content

Test notebooks on pull request #28

Test notebooks on pull request

Test notebooks on pull request #28

Workflow file for this run

# This code is a Qiskit project.
#
# (C) Copyright IBM 2023.
#
# 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
on:
pull_request:
paths:
- "docs/**/*.ipynb"
- "!docs/api/**/*"
workflow_dispatch:
jobs:
execute:
name: Execute notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@af2816c65436325c50621100d67f6e853cd1b0f1
with:
files_yaml: |
# Add your notebook to this list if it needs latex to run
visualization:
- docs/build/circuit-visualization.ipynb
- name: Install LaTeX dependencies
if: ${{ steps.changed-files.outputs.all_changed_files.visualization_any_changed == "true" }}

Check failure on line 41 in .github/workflows/notebook-test.yml

View workflow run for this annotation

GitHub Actions / Test notebooks

Invalid workflow file

The workflow is not valid. .github/workflows/notebook-test.yml (Line: 41, Col: 13): Unexpected symbol: '"true"'. Located at position 76 within expression: steps.changed-files.outputs.all_changed_files.visualization_any_changed == "true"
run: |
sudo apt-get install texlive-pictures texlive-latex-extra poppler-utils
- name: Install Qiskit IBM Runtime to save account
# This is to save our account in the next step. Note that the
# package will be re-installed during the "Run tox" step.
run: pip install qiskit-ibm-runtime
- name: Save IBM Quantum account
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
shell: python
run: |
from qiskit_ibm_runtime import QiskitRuntimeService
QiskitRuntimeService.save_account(
channel="ibm_quantum",
instance="ibm-q/open/main",
token="${{ secrets.IBM_QUANTUM_TEST_TOKEN }}",
set_as_default=True
)
- name: Run tox
uses: lsst-sqre/run-tox@97818256d9fa3c72d0c12f31660718adb495a1cb
with:
python-version: "3.11"
tox-envs: "py311"
tox-posargs: ${{ steps.changed-files.outputs.all_changed_files }}