Skip to content

DO NOT SQUASH Add PyOP2 to Firedrake repository #4

DO NOT SQUASH Add PyOP2 to Firedrake repository

DO NOT SQUASH Add PyOP2 to Firedrake repository #4

Workflow file for this run

name: Pip install Firedrake
on:
# Push to master or PR
push:
branches:
- master
pull_request:
concurrency:
# Cancels jobs running if new commits are pushed
group: >
${{ github.workflow }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build Firedrake"
# Run on our self-hosted machines
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake-env:latest
credentials:
username: firedrake
strategy:
# Don't immediately kill real if complex fails and vice versa.
fail-fast: false
matrix:
include:
- scalar-type: real
petsc_arch: default
- scalar-type: complex
petsc_arch: complex
env:
# PETSC_DIR, HDF5_DIR and MPICH_DIR are set inside the docker image
FIREDRAKE_CI_TESTS: 1
PYOP2_CI_TESTS: 1
PETSC_ARCH: ${{ matrix.petsc_arch }}
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
RDMAV_FORK_SAFE: 1
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
timeout-minutes: 20
limit-access-to-actor: true
- name: Cleanup
if: ${{ always() }}
run: rm -rf pip_venv
- name: Create a venv
run: python3 -m venv pip_venv
- uses: actions/checkout@v4
with:
path: pip_venv/src/firedrake
- name: Pip install
run: |
source pip_venv/bin/activate
cd pip_venv/src
export CC="$MPICH_DIR/mpicc"
export CXX="$MPICH_DIR/mpicxx"
export MPICC="$MPICH_DIR/mpicc"
pip install \
--log=firedrake-install.log \
--no-binary mpi4py,h5py \
-v -e './firedrake[test]'
- name: Add mpiexec to the venv
run: |
source pip_venv/bin/activate
cat << EOF > $VIRTUAL_ENV/bin/mpiexec
#!/bin/bash
$MPICH_DIR/mpiexec "\$@"
EOF
chmod +x $VIRTUAL_ENV/bin/mpiexec
- name: Test Firedrake
run: |
source pip_venv/bin/activate
cd pip_venv/src/firedrake
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS"
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS"
pytest -v tests/firedrake/test_0init.py
pytest \
--durations=200 \
--timeout=1800 \
--timeout-method=thread \
-o faulthandler_timeout=1860 \
-n 12 --dist worksteal \
--junit-xml=firedrake.xml \
-sv tests
timeout-minutes: 120
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5.0.0-a02
if: ${{ always() && ( github.ref != 'refs/heads/master') }}
with:
report_paths: '/__w/firedrake/pip_venv/src/firedrake/firedrake.xml'
comment: true
check_name: "Firedrake ${{ matrix.scalar-type }}"
updateComment: true
flaky_summary: true
- name: Cleanup
# Belt and braces: clean up before and after the run.
if: ${{ always() }}
run: rm -rf pip_venv