Skip to content

Commit 4a4768d

Browse files
authored
ci: split testing and coverage report into separate actions (#60)
The coveralls GitHub Action needs to run on push and pull-request, but it doesn't make sense to run the full test-suite on every push since the code has already been testing during the pull-request. -> split coverage report and testing into two separate GitHub Actions
1 parent 0fa6e9c commit 4a4768d

2 files changed

Lines changed: 38 additions & 10 deletions

File tree

.github/workflows/coveralls.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
#
3+
# https://coveralls.io/
4+
#
5+
6+
name: update coverage report (coveralls)
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
- master
14+
15+
jobs:
16+
coverage:
17+
name: generate coverage report
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: checkout repository
21+
uses: actions/checkout@v4
22+
- name: configure Python (using PDM)
23+
uses: pdm-project/setup-pdm@v4
24+
with:
25+
python-version-file: pyproject.toml
26+
- name: install dependencies
27+
run: |
28+
pdm install
29+
- name: generate coverage report
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
pdm run coverage run --source=feeph.i2c -m pytest tests/
34+
pdm run coveralls
35+
mkdir -p coverage
36+
pdm run coverage-lcov --output_file_path=coverage/lcov.info
37+
- name: coveralls action
38+
uses: coverallsapp/github-action@v2

.github/workflows/validate-code.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ jobs:
6868
if [[ -n $CONTRIB_FILES ]] ; then
6969
pdm run mypy $CONTRIB_FILES
7070
fi
71-
- name: generate coverage report
72-
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74-
run: |
75-
pdm run coverage run --source=feeph.i2c -m pytest tests/
76-
pdm run coveralls
77-
mkdir -p coverage
78-
pdm run coverage-lcov --output_file_path=coverage/lcov.info
79-
- name: coveralls action
80-
uses: coverallsapp/github-action@v2
8171
test:
8272
name: perform unit tests
8373
# wait on linting results; makes no sense to test if the code is broken

0 commit comments

Comments
 (0)