Skip to content

[pre-commit.ci] pre-commit autoupdate #522

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #522

Workflow file for this run

name: Unit tests
on:
push:
branches: [ development, main ]
pull_request:
branches: [ development ]
schedule:
- cron: '0 0 * * 5'
jobs:
unit-tests:
name: "Run Unit Tests"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'poetry'
- name: Install dependencies
run: poetry install
- name: Run unit tests
run: >
poetry run pytest
--junit-xml="output/unit-tests.xml"
--cov
--cov-report="xml:output/coverage.xml"
--cov-report="html:output/htmlcov"
- name: Publish test results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.os }}-${{ matrix.python }}
path: output/**
- name: Upload to Codecov.io
if: success() || failure()
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: output/coverage.xml
flags: unittests
status:
if: ${{ always() }}
runs-on: ubuntu-latest
name: "Unit Test Status"
needs: unit-tests
steps:
- name: Check test matrix status
if: ${{ needs.unit-tests.result != 'success' }}
run: exit 1