Add workflow for tests in GitHub (#4) #2
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: Run Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, '3.10', 3.11, 3.12] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies with Poetry | |
run: | | |
pip install poetry | |
poetry install | |
- name: Run Tests with Coverage | |
if: ${{ matrix.python-version == 3.12 }} | |
run: | | |
poetry run coverage run --source ./pydhn -m unittest -b | |
poetry run coverage report -m | |
- name: Run Tests | |
if: ${{ matrix.python-version != 3.12 }} | |
run: | | |
poetry run python -m unittest -b |