From 887a0f8f661da06218d20bf38215190e3e315823 Mon Sep 17 00:00:00 2001 From: Ben Diehl Date: Fri, 24 May 2024 21:13:44 +0000 Subject: [PATCH] test coverage and test packaging --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7f20b..c90bd8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: permissions: "read-all" jobs: - run-linting: + linting: name: linting via pre-commit runs-on: ubuntu-latest @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" - name: Install pre-commit run: | pip install --upgrade pip @@ -26,8 +26,8 @@ jobs: - name: Run pre-commit steps run: | pre-commit run --all-files - run-tests: - name: tests via pytest + test-coverage: + name: Test base configuration with coverage runs-on: ubuntu-latest steps: @@ -36,17 +36,44 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" - name: Install dependencies run: | pip install --upgrade pip pip install -e .[dev,audit] - name: Run tests run: | - pytest . + coverage run -m pytest + - name: Generate coverage report + run: | + coverage xml + - name: Generate htmp report for inspection + if: failure() + run: | + coverage html - name: Upload coverage + if: always() uses: actions/upload-artifact@v4 with: name: coverage-data path: coverage/coverage.xml if-no-files-found: error + test-packaging: + name: Test packaging + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + pip install --upgrade pip + pip install build twine + - name: Build package + run: | + python -m build + python -m twine check dist/*