test: add tests #95
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: Testing | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
jobs: | |
Testing: | |
runs-on: ubuntu-latest | |
steps: | |
# check-out repo | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
# install poetry | |
- name: Install poetry | |
run: pipx install poetry==1.5 | |
# set-up python with cache | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'poetry' | |
# install requirements (including dev dependencies) | |
- name: Install requirements | |
run: poetry install --with test --no-root | |
# run unit tests | |
- name: Run unit-tests | |
run: | | |
set -o pipefail | |
poetry run make unit-tests-cov-fail | |
# add pytest coverage report to PR | |
- name: Pytest coverage comment | |
if: ${{ success() && github.event_name == 'pull_request' }} | |
id: coverageComment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
title: Coverage Report | |
pytest-coverage-path: pytest-coverage.txt | |
junitxml-path: pytest.xml |