-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (65 loc) · 1.98 KB
/
test_package.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
76
77
78
79
80
81
name: Test package
on:
push:
# The CI is executed on every push on every branch
branches:
- "**"
pull_request:
# The CI is executed on every pull request to the main branch
branches:
- main
workflow_call:
workflow_dispatch:
schedule:
# The CI is executed every day at 8am
- cron: "0 8 * * *"
jobs:
create-datasets:
uses: ./.github/workflows/create_legacy_data.yml
with:
artifact_name: "legacy_mpich"
create-legacy-datasets:
uses: ./.github/workflows/create_legacy_checkpoint.yml
with:
artifact_name: "legacy_checkpoint_mpich"
check-formatting:
uses: ./.github/workflows/check_formatting.yml
test-code:
runs-on: "ubuntu-22.04"
needs: [create-datasets, create-legacy-datasets, check-formatting]
container: ghcr.io/fenics/dolfinx/dolfinx:nightly
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
steps:
- uses: actions/checkout@v4
- name: Update pip
run: python3 -m pip install --upgrade pip setuptools
- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_mpich
path: ./legacy
- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_checkpoint_mpich
path: ./legacy_checkpoint
- name: Install package
run: python3 -m pip install .[test]
- name: Run tests
run: |
coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
- name: Run tests in parallel
run: |
mpirun -n 2 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
- name: Combine coverage reports
run: |
coverage combine
coverage report -m
coverage html
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: htmlcov
if-no-files-found: error