Skip to content

Build

Build #1667

Workflow file for this run

# This workflow will install the python package and dependencies, and run tests against a variety of Python versions
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 0" # Every Sunday
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install base
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install pytest
- name: Test with pytest (Tests should pass without extra dependancies installed)
run: |
python -m quantumflow.about
python -m pytest
- name: Install extra dependencies
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install '.[dev]' # install package + test dependencies
- name: Install extra Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install texlive texlive-latex-extra latexmk poppler-utils
mkdir -p ~/texmf/tex/latex
wget http://mirrors.ctan.org/graphics/pgf/contrib/quantikz/tikzlibraryquantikz.code.tex --no-check-certificate -P ~/texmf/tex/latex
- name: About
if: runner.os == 'Linux'
run: |
python -m quantumflow.about
echo
pdflatex --version
pdftocairo -v
- name: Test coverage with pytest
if: runner.os == 'Linux'
run: |
python -m pytest --cov --cov-fail-under 95
- name: Lint with ruff
if: runner.os == 'Linux'
run: |
python -m ruff check
- name: Typecheck with mypy
if: runner.os == 'Linux'
run: |
mypy quantumflow
- name: Build documentation with sphinx
if: runner.os == 'Linux'
run: |
sphinx-build -M html docs docs/_build
- name: Test notebooks (against main)
if: runner.os == 'Linux'
run: |
pytest --nbmake tutorial