Skip to content
Merged
9 changes: 3 additions & 6 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ on:
inputs:
tag:
description: "Tag of DOLFINx docker image"
default: "nightly"
default: "stable"
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: "Tag of DOLFINx docker image"
default: "nightly"
default: "stable"
required: true
type: string
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -26,7 +23,7 @@ on:

env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
DEFAULT_TAG: nightly
DEFAULT_TAG: stable
ARTIFACT_NAME: docs
PUBLISH_DIR: ./_build/html
PIP_NO_BINARY: h5py
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
with:
tag: "stable"

run-coverage:
uses: ./.github/workflows/test_package.yml
test-code:
uses: ./.github/workflows/test_workflow.yml
with:
tag: "stable"

deploy:
needs: [run-coverage, build-docs]
needs: [build-docs, test-code]

environment:
name: github-pages
Expand All @@ -48,9 +48,10 @@ jobs:
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v7
with:
name: code-coverage-report
name: code-coverage-report-stable
path: "./public/code-coverage-report"


- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test_dolfinx_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test dolfinx versions

on:
push:
branches: [main]
pull_request:

jobs:
# 1. Prerequisite jobs (Data creation)
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"

# 2. The Matrix Job
run-tests:
needs: [create-datasets, create-legacy-datasets]
strategy:
fail-fast: false
matrix:
tag: ["nightly", "stable"]

# Call the reusable workflow
uses: ./.github/workflows/test_workflow.yml
with:
dolfinx_tag: ${{ matrix.tag }}
106 changes: 0 additions & 106 deletions .github/workflows/test_package.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test

on:
workflow_call:
inputs:
dolfinx_tag:
required: true
type: string

jobs:
test-code:
runs-on: ubuntu-24.04
# The container tag is now dynamic based on the input passed by the caller
container: ghcr.io/fenics/dolfinx/dolfinx:${{ inputs.dolfinx_tag }}

steps:
- uses: actions/checkout@v6

- name: Update pip
run: python3 -m pip install --upgrade pip

- name: Install build requirements
run: python3 -m pip install -r build-requirements.txt

# Note: We assume the caller workflow has already uploaded these artifacts
- name: Download legacy mpich data
uses: actions/download-artifact@v7
with:
name: legacy_mpich
path: ./legacy

- name: Download legacy checkpoint mpich data
uses: actions/download-artifact@v7
with:
name: legacy_checkpoint_mpich
path: ./legacy_checkpoint

- name: Install package
run: |
HDF5_MPI=ON HDF5_PKGCONFIG_NAME="hdf5" python3 -m pip install h5py --no-build-isolation --no-binary=h5py
python3 -m pip install .[test]

- name: Show adios2 version
run: python3 -c "import adios2; print(adios2.__version__)"

- name: Show h5py version
run: python3 -c "import h5py; print(h5py.__version__)"

- name: Show hdf5 version
run: python3 -c "import h5py; print(h5py.version.hdf5_version)"

- name: Run tests
run: coverage run --rcfile=.coveragerc -m pytest -xvs ./tests/

- name: Run tests in parallel
run: mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/

- name: Combine coverage reports
run: |
coverage combine
coverage report -m
coverage html

# Use the tag in the artifact name so parallel runs don't overwrite each other
- name: Upload coverage report
uses: actions/upload-artifact@v6
with:
name: code-coverage-report-${{ inputs.dolfinx_tag }}
path: htmlcov
if-no-files-found: error