-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (79 loc) · 2.54 KB
/
test_redhat.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
name: Test package with redhat
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
jobs:
create-datasets:
uses: ./.github/workflows/create_legacy_data.yml
with:
artifact_name: "legacy_ompi"
create-legacy-datasets:
uses: ./.github/workflows/create_legacy_checkpoint.yml
with:
artifact_name: "legacy_checkpoint_ompi"
test-code:
runs-on: "ubuntu-22.04"
needs: [create-datasets, create-legacy-datasets]
container: docker.io/fenicsproject/test-env:current-redhat
env:
DEB_PYTHON_INSTALL_LAYOUT: deb_system
PETSC_ARCH: ""
PETSC_DIR: "/usr/local/"
PYTHONPATH: "/usr/local/lib/:${PYTHONPATH}"
working-directory: ./src
strategy:
matrix:
adios2: ["v2.10.2"]
steps:
- uses: actions/checkout@v4
- name: Get pip flags based on version
id: python-version
shell: bash -el {0}
run: |
MODERN_PIP=$(python3 -c "import sys; t = sys.version_info >= (3, 11, 0); sys.stdout.write(str(t))")
if [ ${MODERN_PIP} == "True" ]; then
FLAGS="--break-system-packages"
else
FLAGS=""
python3 -m pip install --upgrade pip
fi
echo "PYTHON_FLAGS=${FLAGS}" >> "$GITHUB_OUTPUT"
- name: Update pip
run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} --upgrade pip setuptools
- name: Install DOLFINx
uses: jorgensd/actions/[email protected]
with:
adios2: ${{ matrix.adios2 }}
petsc_arch: ${{ env.PETSC_ARCH }}
petsc_dir: ${{ env.PETSC_DIR }}
dolfinx: main
basix: main
ufl: main
ffcx: main
working-directory: ${{ env.working-directory}}
- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_ompi
path: ./legacy
- name: Download legacy data
uses: actions/download-artifact@v4
with:
name: legacy_checkpoint_ompi
path: ./legacy_checkpoint
- name: Install package
run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} --check-build-dependencies .[test]
- name: Run tests
run: |
coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests
- name: Run tests in parallel
run: |
mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests