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