Skip to content

Commit fd84de7

Browse files
authored
Merge pull request #9 from scientificcomputing/finsberg/deploy-pages
Update GitHub workflows
2 parents 92415d8 + bdb15e6 commit fd84de7

File tree

5 files changed

+109
-116
lines changed

5 files changed

+109
-116
lines changed

.github/workflows/build_docs.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ on:
55
inputs:
66
tag:
77
description: "Tag of DOLFINx docker image"
8-
default: "nightly"
8+
default: "stable"
99
required: true
1010
type: string
1111
workflow_dispatch:
1212
inputs:
1313
tag:
1414
description: "Tag of DOLFINx docker image"
15-
default: "nightly"
15+
default: "stable"
1616
required: true
1717
type: string
18-
push:
19-
branches:
20-
- main
2118
pull_request:
2219
branches:
2320
- main
@@ -26,7 +23,7 @@ on:
2623

2724
env:
2825
DEB_PYTHON_INSTALL_LAYOUT: deb_system
29-
DEFAULT_TAG: nightly
26+
DEFAULT_TAG: stable
3027
ARTIFACT_NAME: docs
3128
PUBLISH_DIR: ./_build/html
3229
PIP_NO_BINARY: h5py

.github/workflows/deploy_pages.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
with:
2323
tag: "stable"
2424

25-
run-coverage:
26-
uses: ./.github/workflows/test_package.yml
25+
test-code:
26+
uses: ./.github/workflows/test_workflow.yml
2727
with:
2828
tag: "stable"
2929

3030
deploy:
31-
needs: [run-coverage, build-docs]
31+
needs: [build-docs, test-code]
3232

3333
environment:
3434
name: github-pages
@@ -48,9 +48,10 @@ jobs:
4848
# docs artifact is uploaded by build-docs job
4949
uses: actions/download-artifact@v7
5050
with:
51-
name: code-coverage-report
51+
name: code-coverage-report-stable
5252
path: "./public/code-coverage-report"
5353

54+
5455
- name: Upload artifact
5556
uses: actions/upload-pages-artifact@v4
5657
with:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test dolfinx versions
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
# 1. Prerequisite jobs (Data creation)
10+
create-datasets:
11+
uses: ./.github/workflows/create_legacy_data.yml
12+
with:
13+
artifact_name: "legacy_mpich"
14+
15+
create-legacy-datasets:
16+
uses: ./.github/workflows/create_legacy_checkpoint.yml
17+
with:
18+
artifact_name: "legacy_checkpoint_mpich"
19+
20+
# 2. The Matrix Job
21+
run-tests:
22+
needs: [create-datasets, create-legacy-datasets]
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
tag: ["nightly", "stable"]
27+
28+
# Call the reusable workflow
29+
uses: ./.github/workflows/test_workflow.yml
30+
with:
31+
dolfinx_tag: ${{ matrix.tag }}

.github/workflows/test_package.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
dolfinx_tag:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
test-code:
12+
runs-on: ubuntu-24.04
13+
# The container tag is now dynamic based on the input passed by the caller
14+
container: ghcr.io/fenics/dolfinx/dolfinx:${{ inputs.dolfinx_tag }}
15+
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- name: Update pip
20+
run: python3 -m pip install --upgrade pip
21+
22+
- name: Install build requirements
23+
run: python3 -m pip install -r build-requirements.txt
24+
25+
# Note: We assume the caller workflow has already uploaded these artifacts
26+
- name: Download legacy mpich data
27+
uses: actions/download-artifact@v7
28+
with:
29+
name: legacy_mpich
30+
path: ./legacy
31+
32+
- name: Download legacy checkpoint mpich data
33+
uses: actions/download-artifact@v7
34+
with:
35+
name: legacy_checkpoint_mpich
36+
path: ./legacy_checkpoint
37+
38+
- name: Install package
39+
run: |
40+
HDF5_MPI=ON HDF5_PKGCONFIG_NAME="hdf5" python3 -m pip install h5py --no-build-isolation --no-binary=h5py
41+
python3 -m pip install .[test]
42+
43+
- name: Show adios2 version
44+
run: python3 -c "import adios2; print(adios2.__version__)"
45+
46+
- name: Show h5py version
47+
run: python3 -c "import h5py; print(h5py.__version__)"
48+
49+
- name: Show hdf5 version
50+
run: python3 -c "import h5py; print(h5py.version.hdf5_version)"
51+
52+
- name: Run tests
53+
run: coverage run --rcfile=.coveragerc -m pytest -xvs ./tests/
54+
55+
- name: Run tests in parallel
56+
run: mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
57+
58+
- name: Combine coverage reports
59+
run: |
60+
coverage combine
61+
coverage report -m
62+
coverage html
63+
64+
# Use the tag in the artifact name so parallel runs don't overwrite each other
65+
- name: Upload coverage report
66+
uses: actions/upload-artifact@v6
67+
with:
68+
name: code-coverage-report-${{ inputs.dolfinx_tag }}
69+
path: htmlcov
70+
if-no-files-found: error

0 commit comments

Comments
 (0)