Skip to content
name: Run tests, mypy and pre-commit hooks
on: push
jobs:
unit_tests:
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false)
name: Unit testing
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout main code and submodules
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install main dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Install and run pre-commit hooks
run: |
pip install pre-commit
pre-commit run
- name: Perform unit tests
run: |
pytest -vvv --cov
- name: Mypy checks only for Python 3.8
if: ${{ matrix.python-version == 3.8 }}
run: |
mypy pasqal_cloud