diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad64dd0..f9818dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,10 @@ jobs: test: name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} + permissions: + contents: write + pull-requests: write + checks: write strategy: fail-fast: false matrix: @@ -74,16 +78,39 @@ jobs: run: uv sync --all-extras - name: Run tests with coverage - run: uv run pytest + run: uv run pytest --cov=crump --cov-report=xml --cov-report=term --junitxml=test-results.xml + + - name: Upload test results + if: always() && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' + uses: actions/upload-artifact@v5 + with: + name: test-results-linux-3.14 + path: test-results.xml + + - name: Publish Test Report + if: always() && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: test-results.xml + check_name: 'Test Results (Linux 3.14)' - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' uses: codecov/codecov-action@v5 with: - file: ./coverage.xml + files: ./coverage.xml fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} + - name: Coverage comment + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' + uses: py-cov-action/python-coverage-comment-action@v3 + with: + GITHUB_TOKEN: ${{ github.token }} + COVERAGE_DATA_BRANCH: ${{ github.head_ref || github.ref_name }} + MINIMUM_GREEN: 80 + MINIMUM_ORANGE: 70 + build: name: Build package runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index a05a3b2..3adb1db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,7 @@ filterwarnings = [ [tool.coverage.run] source = ["src/crump"] omit = ["*/tests/*", "*/__pycache__/*"] +relative_files = true [tool.coverage.report] exclude_lines = [