Skip to content

Commit

Permalink
Merge pull request #29 from masenf/coverage-paths
Browse files Browse the repository at this point in the history
tox.ini: [coverage:paths] mapping
  • Loading branch information
masenf committed Dec 11, 2022
2 parents 211ac6e + 3384356 commit 1c85ecc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- pull_request

jobs:
build:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -22,16 +22,44 @@ jobs:
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions coveralls
- name: Test with tox
run: tox
run: tox -- tests/unit --cov tox_pin_deps
- name: Upload coverage data
if: always()
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_FLAG_NAME: unit-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
integration:
needs: unit
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions coveralls
- name: Test with tox
run: tox -- tests/integration --cov tox_pin_deps
- name: Upload coverage data
if: always()
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: integration-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: build
if: ${{ always() }}
needs: [unit, integration]
runs-on: ubuntu-latest
container: python:3-slim
steps:
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@ branch = True
parallel = True

[coverage:report]
fail_under = 100
show_missing = True

[coverage:paths]
# this maps paths in the `.tox` directory to the top level when combining
source =
src/tox_pin_deps
.tox/*/lib/python*/site-packages/tox_pin_deps

0 comments on commit 1c85ecc

Please sign in to comment.