Skip to content

Commit

Permalink
Add a pip install workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JDBetteridge committed Nov 14, 2024
1 parent aedbccd commit 687471c
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
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
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: Cleanup
if: ${{ always() }}
run: rm -rf pip_venv

- name: Create a venv
run: python -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

0 comments on commit 687471c

Please sign in to comment.