diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e0b3071..6353adbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,25 @@ jobs: - name: Test built package run: | - pip install pytest + pip install pytest pytest-cov pip install ./target - pytest -v pipeline/tests + if [ "${{ matrix.python-version }}" = "3.14" ]; then + # Put the in-tree build first on the path, so that coverage is recorded + # against target/openminds rather than the copy in site-packages, whose + # path changes with every Python patch release. + PYTHONPATH=target pytest -v --cov=openminds --cov-report term --cov-report lcov pipeline/tests + else + pytest -v pipeline/tests + fi + + - name: Upload coverage to Coveralls + if: matrix.python-version == '3.14' + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: coverage.lcov + parallel: false + fail-on-error: false - name: Checkout main branch uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4584eed..cd407bd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,19 @@ jobs: pip install pytest pytest-cov pip install ./target if [ "${{ matrix.python-version }}" = "3.14" ]; then - pytest -v --cov=openminds --cov-report term pipeline/tests + # Put the in-tree build first on the path, so that coverage is recorded + # against target/openminds rather than the copy in site-packages, whose + # path changes with every Python patch release. + PYTHONPATH=target pytest -v --cov=openminds --cov-report term --cov-report lcov pipeline/tests else pytest -v pipeline/tests fi + + - name: Upload coverage to Coveralls + if: matrix.python-version == '3.14' + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: coverage.lcov + parallel: false + fail-on-error: false