Skip to content

Testing the code in the paper #70

Testing the code in the paper

Testing the code in the paper #70

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: QOKit test
on: # workflow_dispatch
push:
branches: [ "main", "**" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
###### Alex: to be used in future version once permissions issue is resolved
# - name: black
# uses: lgeiger/black-action@master
# with:
# args: .
# - name: Apply black formatting if reviewdog found formatting errors
# if: "${{ failure() }}"
# run: |
# black .
# - name: Commit black formatting results
# if: "${{ failure() }}"
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: ":art: Format Python code with psf/black push"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipreqs black addheader pytest-cov pip-licenses
- name: black check
run: |
black --check .
- name: pip install
run: |
pip install .
- name: Run tests
run: |
pytest --cov=qokit --cov-fail-under=75 -rs tests
- name: License check
run: |
pip-licenses --format=markdown --order=license
- name: SPDX check
run: |
addheader -t header.txt .
grep -L -f header.txt */*.py