-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (48 loc) · 1.86 KB
/
test_package_coverage.yml
File metadata and controls
58 lines (48 loc) · 1.86 KB
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
name: Test package
on:
pull_request:
push:
branches: [main]
jobs:
test-code:
name: Test on ${{ matrix.container }}
runs-on: ubuntu-24.04
container: ${{ matrix.container }}
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
strategy:
fail-fast: false
matrix:
container: [
"ghcr.io/fenics/dolfinx/dolfinx:stable",
"ghcr.io/fenics/dolfinx/dolfinx:nightly"
]
steps:
- uses: actions/checkout@v6
- name: Install build dependencies
run: |
python3 -m pip install -r https://raw.githubusercontent.com/scientificcomputing/scifem/refs/heads/main/build-requirements.txt
- name: Install development versions of dependencies
if: ${{ matrix.container == 'ghcr.io/fenics/dolfinx/dolfinx:nightly' }}
run: |
python3 -m pip install git+https://github.com/scientificcomputing/io4dolfinx.git
python3 -m pip install git+https://github.com/scientificcomputing/scifem.git --no-build-isolation
python3 -m pip install git+https://github.com/ComputationalPhysiology/cardiac-geometriesx.git
- name: Install package
run: |
python3 -m pip install scifem --no-build-isolation
python3 -m pip install .[test]
- name: Run tests
run: python3 -m pytest -m "not benchmark"
- name: Extract Coverage
run: |
python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
python3 -m coverage json
export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
- name: Upload HTML report.
if: ${{ matrix.container == 'ghcr.io/fenics/dolfinx/dolfinx:stable' }}
uses: actions/upload-artifact@v7
with:
name: html-report
path: htmlcov