-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (69 loc) · 2.13 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Coverage
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
test-under-coverage:
runs-on: ubuntu-latest
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: "Coverage (Sphinx ~=5)" # jQuery deprecated
sphinx: "sphinx>=5.0.0a0,<6"
- name: "Coverage (Sphinx >=6)" # jQuery removed
sphinx: "sphinx>=6.0.0a0"
steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3"
cache: pip
cache-dependency-path: .github/workflows/coverage.yml
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: python -m pip install -U pytest coverage[toml] "${{ matrix.sphinx }}"
- name: Install sphinxcontrib-jquery
run: python -m pip install .
- name: Run pytest
run: coverage run --parallel -m pytest -vv
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: .coverage.*
if-no-files-found: ignore
coverage:
name: Report coverage
runs-on: ubuntu-latest
needs: test-under-coverage
steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3"
cache: pip
cache-dependency-path: .github/workflows/coverage.yml
- name: Update pip
run: python -m pip install -U pip
- name: Install coverage
run: python -m pip install -U coverage[toml]
- uses: actions/download-artifact@v3
with:
name: coverage-reports
- name: Combine coverage; fail if not 100%
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
python -m coverage report --fail-under=100
- name: Upload the HTML coverage report on failure
if: failure()
uses: actions/upload-artifact@v3
with:
name: html-report
path: htmlcov