Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
ci: add code coverage integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Dec 18, 2023
1 parent 001f2f7 commit 7aad7e4
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 47 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = tests/*
48 changes: 48 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ jobs:
path: |
${{ github.workspace }}/artifacts
- name: Test with pytest
id: test
shell: bash
run: |
python -m pytest \
-rxXs \
--tb=native \
--verbose \
--cov-config=.coveragerc \
--cov=pyra \
--cov=. \
tests
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.architecture }}
path: .coverage

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
uses: LizardByte/create-release-action@v2023.1210.832
Expand All @@ -121,3 +140,32 @@ jobs:
prerelease: true # ${{ needs.setup_release.outputs.publish_pre_release }}
tag: ${{ needs.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}

coverage:
name: Process test coverage (${{ matrix.os }}-${{ matrix.architecture }})
runs-on: ${{ matrix.os }}
needs: build
if: always() # code coverage tracks coverage on all branches
strategy:
fail-fast: false
matrix:
os: [windows-2019, ubuntu-20.04, macos-11]
architecture: [x64]
include: # additional runs
- os: windows-2019
architecture: x86
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.architecture }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: .coverage
flags: ${{ runner.os }}-${{ matrix.architecture }}
47 changes: 0 additions & 47 deletions .github/workflows/python-tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
flake8==6.1.0
pyinstaller==6.3.0
pytest==7.4.3
pytest-cov==4.1.0
rstcheck[sphinx]==6.2.0

0 comments on commit 7aad7e4

Please sign in to comment.