From 276fc4297caf69da2deb4c1334dd49375a248dbb Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 16 Jun 2021 16:54:16 -0700 Subject: [PATCH] Enable codecov.io, refs #275 --- .github/workflows/test-coverage.yml | 42 +++++++++++++++++++++++++++++ codecov.yml | 8 ++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/test-coverage.yml create mode 100644 codecov.yml diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml new file mode 100644 index 0000000..31a37fa --- /dev/null +++ b/.github/workflows/test-coverage.yml @@ -0,0 +1,42 @@ +name: Calculate test coverage + +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - uses: actions/cache@v2 + name: Configure pip caching + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[test] + python -m pip install pytest-cov + - name: Run tests + run: |- + ls -lah + cat .coveragerc + pytest --cov=sqlite_utils --cov-report xml:coverage.xml --cov-report term + ls -lah + - name: Upload coverage report + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: coverage.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..bfdc987 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true