-
Notifications
You must be signed in to change notification settings - Fork 160
110 lines (100 loc) · 3.23 KB
/
pip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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 using pip"
# Run on our self-hosted machines
runs-on: [self-hosted, Linux]
container:
image: firedrakeproject/firedrake-env:latest
options: --user root
defaults:
run:
shell: bash
working-directory: /home/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: Cleanup
if: ${{ always() }}
run: rm -rf pip_venv
- name: Create a venv
run: python3 -m venv pip_venv
- uses: actions/checkout@v4
with:
path: src/firedrake
- name: Pip install
run: |
ln -s /__w/firedrake/firedrake/src pip_venv/
source pip_venv/bin/activate
cd pip_venv/src
export CC="$MPICH_DIR/mpicc"
export CXX="$MPICH_DIR/mpicxx"
export MPICC="$MPICH_DIR/mpicc"
export MPI_HOME="$PETSC_DIR/packages"
pip install \
--log=firedrake-install.log \
--no-binary mpi4py,h5py \ # do these need to be no-binary?
-v -e './firedrake[test]' # must the install be editable?
- name: Add mpiexec to the venv and install timeout
run: |
source pip_venv/bin/activate
cat << EOF > "$VIRTUAL_ENV/bin/mpiexec"
#!/bin/bash
"$MPICH_DIR"/mpiexec "\$@"
EOF
chmod +x "$VIRTUAL_ENV"/bin/mpiexec
pip install -U pytest-timeout
- name: Run Firedrake smoke tests
run: |
source pip_venv/bin/activate
cd pip_venv/src/firedrake
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/firedrake/regression -k "poisson_strong or stokes_mini or dg_advection"
timeout-minutes: 120
- name: Publish Test Report
uses: mikepenz/[email protected]
if: ${{ always() && ( github.ref != 'refs/heads/master') }}
with:
report_paths: '/home/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