Run unit tests #242
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
run-name: Run unit tests | |
on: | |
- pull_request | |
- workflow_call | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install coinor-libipopt-dev | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment (if no poetry.toml file) | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v4 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install the project dependencies | |
run: poetry install --without solvers | |
- name: Test with pytest | |
run: poetry run pytest --timeout=300 -o log_level=info -o log_cli=true -v --isort --black | |
- name: Test with mypy | |
run: poetry run mypy pygradflow | |
- name: Test with pyflakes | |
run: poetry run pyflakes pygradflow |