From c209eef0cd712ab9c55dc681079b609ec623d126 Mon Sep 17 00:00:00 2001 From: boxydog Date: Sat, 8 Jun 2024 08:45:06 -0500 Subject: [PATCH] Add coverage test --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c0127df..3255bd4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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