Skip to content

Remove redhat and try to install dolfinx from source #1

Remove redhat and try to install dolfinx from source

Remove redhat and try to install dolfinx from source #1

Workflow file for this run

name: Test

Check failure on line 1 in .github/workflows/test_workflow.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test_workflow.yml

Invalid workflow file

(Line: 42, Col: 5): 'runs-on' is already defined
on:
workflow_call:
inputs:
dolfinx_tag:
required: true
type: string
jobs:
get_image_tag:
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker_tag.outputs.image }}
steps:
- name: Validate inputs
run: |
if [[ "${{ inputs.dolfinx_tag }}" != "stable" && "${{ inputs.dolfinx_tag }}" != "nightly"; then
echo "::error::Invalid DOLFINx enviroment: ${{ inputs.dolfinx_tag }}. Allowed values: stable, nightly"
exit 1
fi
- id: Nightly
if: (${{ inputs.dolfinx_tag }} == 'nightly')
run: |
echo "branch=main" >> $GITHUB_OUTPUT
echo "image=current" >> $GITHUB_OUTPUT
- id: Stable
if: (${{ inputs.dolfinx_tag }} == 'stable')
run: |
echo "branch=release" >> $GITHUB_OUTPUT
echo "image=stable" >> $GITHUB_OUTPUT
test-code:
runs-on: ubuntu-latest
needs: get_image_tag
runs-on: ubuntu-latest
container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }}
steps:
- uses: actions/checkout@v6
- name: Install DOLFINx
uses: jorgensd/actions/install-dolfinx@v0.4
with:
dolfinx: ${{ needs.get_image_tag.outputs.branch }}
basix: ${{ needs.get_image_tag.outputs.branch }}
ufl: ${{ needs.get_image_tag.outputs.branch }}
ffcx: ${{ needs.get_image_tag.outputs.branch }}
working-directory: ${{ env.working-directory}}
- 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