Skip to content

Commit

Permalink
ci: add coverage test
Browse files Browse the repository at this point in the history
  • Loading branch information
hrz6976 committed Jun 14, 2024
1 parent f49b412 commit 09c4ac5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Generate docs

on: [push]
on:
push:

jobs:
generate-docs:
name: Docs
name: docs
runs-on: ubuntu-latest
# only on default branch
if: github.ref_name == github.event.repository.default_branch
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Run unit tests

on: [push, pull_request]
on:
push:
pull_request:

jobs:
test:
name: Python ${{ matrix.python-version }}
name: python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -37,3 +39,20 @@ jobs:
- name: Run tests
run: |
poetry run pytest -v
- name: Measure coverage
if : ${{ github.event_name == 'push' && github.ref == github.event.repository.default_branch }}
run: |
poetry run pytest -v --cov --cov-report=xml
- name: Upload to Codecov
if : ${{ github.event_name == 'push' && github.ref == github.event.repository.default_branch }}
uses: codecov/codecov-action@v4
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./coverage.xml
name: python-woc
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

0 comments on commit 09c4ac5

Please sign in to comment.