Add coverage test

This commit is contained in:
boxydog 2024-06-08 08:45:06 -05:00
commit c209eef0cd

View file

@ -39,14 +39,23 @@ jobs:
pandoc-version: "2.9.2"
- name: Install tox
run: python -m pip install -U pip tox
- name: Install invoke
run: python -m pip install invoke
- name: Info
run: |
echo "===== PYTHON ====="
python --version
echo "===== PANDOC ====="
pandoc --version | head -2
- name: Run tests
run: tox -e py${{ matrix.python }}
- name: Run tests with coverage
run: invoke coverage
- name: Upload coverage data
uses: "actions/upload-artifact@v4"
with:
name: coverage-data
path: ".coverage.*"
if-no-files-found: error
lint:
name: Lint
@ -66,6 +75,32 @@ jobs:
- name: Run pre-commit checks on all files
uses: pre-commit/action@v3.0.1
coverage:
runs-on: "ubuntu-latest"
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/requirements/*"
- name: "Install Coverage.py"
run: "python -m pip install --upgrade coverage[toml]"
- name: "Download coverage data"
uses: actions/download-artifact@v4
with:
name: coverage-data
- name: "Combine & check coverage"
run: |
set -xe
python -m coverage combine
python -m coverage report --fail-under=74
build:
name: Test build
runs-on: ubuntu-latest