From 786f2c2bc5cf9b91c1c2b1173f22d89305a7bd61 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 29 Jun 2025 15:20:05 -0400 Subject: [PATCH] Add coverage to CI workflow --- .github/workflows/python-ci.yml | 20 +++++++++++++++++--- src/requirements.txt | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index e962843..e3fe1a1 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -14,9 +14,23 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.11' - - name: Install dependencies + - name: Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('src/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Set up Python dependencies + id: deps run: | python -m pip install --upgrade pip pip install -r src/requirements.txt - - name: Test with pytest - run: pytest -q src/tests + - name: Run tests with coverage + run: | + pytest --cov=src --cov-report=xml --cov-report=term-missing src/tests + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: coverage-xml + path: coverage.xml diff --git a/src/requirements.txt b/src/requirements.txt index 5042da5..b195427 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -9,4 +9,5 @@ aiohttp bcrypt bip85 pytest>=7.0 +pytest-cov