Add support for Enums #29 #135
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: Continuous Integration | |
on: [push] | |
jobs: | |
testing: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Cache pre-commit tools | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ matrix.python-version }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache Poetry installation | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local/bin/poetry | |
~/.local/venv/ | |
key: poetry | |
- name: Install Poetry | |
if: ${{ !steps.cached-poetry.outputs.cache-hit }} | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.3.1 | |
- name: Cache pip data | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip/ | |
key: pip | |
- name: Create project venv | |
run: poetry env use python${{ matrix.python-version }} | |
- name: Install dependencies | |
run: poetry install | |
- name: Run pre-commit checks | |
run: poetry run pre-commit run --all | |
- name: Run mypy | |
run: poetry run mypy src/ tests/ | |
- name: Run unit tests | |
run: poetry run pytest --cov=. --cov-config=pyproject.toml | |
env: | |
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}" | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: .coverage.${{ matrix.python-version }} | |
retention-days: 7 | |
coverage: | |
runs-on: ubuntu-latest | |
needs: testing | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python (latest) | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
# When combining under 3.11, decorators are reported as partially covered. | |
# The symptoms look similar to this older issue: | |
# https://github.com/nedbat/coveragepy/issues/866 | |
- name: Cache Poetry installation | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local/bin/poetry | |
~/.local/venv/ | |
key: poetry | |
- name: Cache pip data | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip/ | |
key: pip | |
- name: Install coverage tool | |
run: poetry install --only=coverage | |
- name: Download coverage data. | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-data | |
- name: Combine coverage data | |
run: poetry run coverage combine | |
- name: Generate HTML coverage report | |
run: poetry run coverage html --skip-covered --skip-empty | |
- name: Fail if coverage is not 100% | |
run: poetry run coverage report --fail-under=100 | |
- name: Upload HTML report if check failed. | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: htmlcov | |
if: ${{ failure() }} |