Skip to content

Fix rendering in quantum kernel methods notebook #111

Fix rendering in quantum kernel methods notebook

Fix rendering in quantum kernel methods notebook #111

# This is a basic workflow that is manually triggered
name: Rerun notebooks and build docs
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
pull_request:
branches:
- main
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
perceval-extensive-autotests:
name: Run PyTest on ${{ matrix.os }} and with python version ${{ matrix.version }}
if: always()
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
version: [3.9, 3.13] # only running with oldest and newest version
steps:
- if: runner.os == 'Linux'
name: Initialize PYTHON_V_CP linux
run: |
echo "PYTHON_V_CP=cp$( echo '${{matrix.version}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Initialize PYTHON_V_CP notLinux
run: |
echo "PYTHON_V_CP=cp$( echo '${{matrix.version}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
shell: Bash
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
build-env:
name: Rerun notebooks and build docs
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
# Documentation needs 3.11 to be built
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[all]
python -m pip install -r docs/requirements.txt -r docs/source/notebooks/requirements.txt
- name: Rerun notebooks
run: |
./.github/workflows/rerun_notebooks.sh
- name: Install Pandoc
run: |
sudo apt update
sudo apt install pandoc
- name: Build docs
run: |
cd docs
make multiversion
- name: 'Create docs Artefact'
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/build/html
retention-days: 1