Skip to content

Commit

Permalink
actions: support coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Nov 6, 2024
1 parent 20a083a commit 0baddcb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 38 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,44 @@ jobs:
name: package
path: ./pkg/**/*

coverage:
name: Combine & check coverage.
needs: [ matrix, matrix-main-frameworks ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
# Use latest Python, so it understands all syntax.
python-version: 3.11

- run: python -Im pip install --upgrade coverage[toml]

- uses: actions/download-artifact@v4
with:
pattern: coverage-reports-*
merge-multiple: true

- name: Combine coverage
run: |
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
# Report and write to summary.
python -Im coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-coverage-report
path: htmlcov

- uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # 5.1.0
with:
name: coverage-reports-*

all:
if: always()
runs-on: ubuntu-latest
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/coverage-reporter.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/run-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ jobs:
}
const framework = normalizeName('${{ matrix.framework }}')
const version = normalizeName('${{ matrix.version }}')
return `test-results-${version}-${framework}`
return `${version}-${framework}`
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v4
with:
name: ${{ steps.normalize-junit.outputs.result }}
name: test-results-${{ steps.normalize-junit.outputs.result }}
path: "**/spec/junit-reports/**/*ruby-agent-junit.xml"
- if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
name: coverage-reports-${{ steps.normalize-junit.outputs.result }}
path: "coverage/"

0 comments on commit 0baddcb

Please sign in to comment.