Skip to content

Commit

Permalink
minor cleanups on the coverage action
Browse files Browse the repository at this point in the history
  • Loading branch information
oddbookworm committed Jul 20, 2024
1 parent 1cca3e7 commit b62ed96
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build-ubuntu-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ on:
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# gcov/lcov only gets C coverage
- 'src_py/**'
# re-include current file to not be excluded
- '!.github/workflows/build-ubuntu-coverage.yml'

Expand Down Expand Up @@ -68,8 +70,9 @@ jobs:
pip3 install numpy>=1.21.0
- name: Build with coverage hooks and install
id: build
run: |
pip3 install -e . --no-build-isolation -Cbuild-dir=.mesonpy-rel -Csetup-args=-Dcoverage=true
pip3 install -e ${{ github.workspace }} --no-build-isolation -Cbuild-dir=${{ github.workspace }}/.mesonpy-rel -Csetup-args=-Dcoverage=true
- name: Run tests
env:
Expand All @@ -78,14 +81,17 @@ jobs:
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300

- name: Generate coverage
if: always()
id: gen-coverage
# want to continue regardless of whether a test failed or not as long as the job wasn't cancelled
if: ${{ steps.build.conclusion == 'success' && !cancelled() }}
run: |
lcov --capture --directory . --output-file coverage.info
genhtml coverage.info --output-directory ${{ github.workspace}}/out
lcov --capture --directory ${{ github.workspace }}/ --output-file ${{ github.workspace }}/coverage.info
genhtml ${{ github.workspace }}/coverage.info --output-directory ${{ github.workspace }}/out
# We upload the generated files under github actions assets
- name: Upload coverage
if: always()
- name: Upload coverage html
# want to continue only if the coverage generation was successful
if: ${{ steps.gen-coverage.conclusion == 'success' && !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-coverage
Expand Down

0 comments on commit b62ed96

Please sign in to comment.