Skip to content

examples: add quickstart examples for the qiskit homepage. #35

examples: add quickstart examples for the qiskit homepage.

examples: add quickstart examples for the qiskit homepage. #35

Workflow file for this run

name: Tests
on:
push:
branches: [ master, 'stable/*' ]
pull_request:
branches: [ master, 'stable/*' ]
jobs:
tests:
name: tests-python${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
poetry-version: [1.5.1]
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Check Poetry lock file status
run: poetry lock --check
- name: Check shell scripts
uses: ludeeus/[email protected]
- name: Install coverage tool
run: |
poetry run pip install coverage[toml]
- name: Install examples dependencies (Py3.11)
run: |
poetry install --only main --extras examples
# tweedledum has no wheel for Python3.11 and the build errors
if: matrix.python-version == '3.11'
- name: Install examples dependencies (~Py3.11)
run: |
poetry install --only main --all-extras
if: matrix.python-version != '3.11'
- name: Run examples
run: |
poetry run examples/run_all.sh -c
- name: Install all dependencies
run: poetry install --sync
- name: Check version numbers consistency
run: poetry run poe version_check
- name: Check formatting
run: poetry run poe format_check
- name: Linting
run: poetry run poe lint
- name: Type checking
run: poetry run poe typecheck
- name: Testing
run: poetry run poe test --cov_opts="-a" # add to examples coverage
- name: Docs
run: poetry run poe docs
- name: Generate HTML coverage report
run: poetry run coverage html --show-contexts
- name: Upload HTML coverage report
uses: actions/upload-artifact@v3
with:
name: html-coverage
path: htmlcov/
# - name: Generate XML coverage report
# run: poetry run coverage xml -o coverage.xml
# - name: Read global coverage target
# id: coverage-target
# run: echo "fail-under=$(poetry run python scripts/read-target-coverage.py)" >> $GITHUB_OUTPUT
# - name: Post coverage comment
# if: ${{ github.event_name == 'pull_request' }}
# uses: orgoro/coverage@v3
# with:
# coverageFile: coverage.xml
# token: ${{ secrets.GITHUB_TOKEN }}
# thresholdAll: ${{ steps.coverage-target.outputs.fail-under }}
# thresholdNew: 0
# thresholdModified: 0