-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (46 loc) · 1.38 KB
/
measure-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Measure code coverage by line
env:
CLONE_PATH: ${{ github.workspace }}
COVERAGE_FILE: ${{ github.workspace }}/coverage
HTML_REPORT: ${{ github.workspace }}/htmlcov
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
coverage_ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
##-- General Setup Steps
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup python with tox
run: $CLONE_PATH/.github/workflows/install_tox.sh
##-- Run test with coverage
- name: Generate full coverage for coveralls
run: |
pushd $CLONE_PATH
tox -r -e coverage,report
popd
##-- Publish full coverage report as artifact
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-results
path: |
${{ env.COVERAGE_FILE }}
${{ env.HTML_REPORT }}
##-- Publish full coverage report to Coveralls
- name: Push report to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install --upgrade coveralls
coveralls --service=github --basedir=$CLONE_PATH