Debian Codegraph @

.github/workflows/test_redhat.yml

raw
1 name: Test package with redhat
2
3 on:
4 # push:
5 # branches:
6 # - main
7 # pull_request:
8 # branches:
9 # - main
10
11 workflow_call:
12 workflow_dispatch:
13 # schedule:
14 # - cron: "0 8 * * *"
15
16 jobs:
17 create-datasets:
18 uses: ./.github/workflows/create_legacy_data.yml
19 with:
20 artifact_name: "legacy_ompi"
21
22 create-legacy-datasets:
23 uses: ./.github/workflows/create_legacy_checkpoint.yml
24 with:
25 artifact_name: "legacy_checkpoint_ompi"
26
27 test-code:
28 runs-on: "ubuntu-22.04"
29 needs: [create-datasets, create-legacy-datasets]
30 container: docker.io/fenicsproject/test-env:current-redhat
31 env:
32 DEB_PYTHON_INSTALL_LAYOUT: deb_system
33 PETSC_ARCH: ""
34 PETSC_DIR: "/usr/local/"
35 PYTHONPATH: "/usr/local/lib/:${PYTHONPATH}"
36 working-directory: ./src
37
38 strategy:
39 matrix:
40 adios2: ["master"]
41 steps:
42 - uses: actions/checkout@v5
43
44 - name: Get pip flags based on version
45 id: python-version
46 shell: bash -el {0}
47 run: |
48 MODERN_PIP=$(python3 -c "import sys; t = sys.version_info >= (3, 11, 0); sys.stdout.write(str(t))")
49 if [ ${MODERN_PIP} == "True" ]; then
50 FLAGS="--break-system-packages"
51 else
52 FLAGS=""
53 python3 -m pip install --upgrade pip
54 fi
55 echo "PYTHON_FLAGS=${FLAGS}" >> "$GITHUB_OUTPUT"
56
57 - name: Update pip
58 run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} --upgrade pip setuptools
59
60 - name: Install DOLFINx
61 uses: jorgensd/actions/[email protected]
62 with:
63 adios2: ${{ matrix.adios2 }}
64 petsc_arch: ${{ env.PETSC_ARCH }}
65 petsc_dir: ${{ env.PETSC_DIR }}
66 dolfinx: main
67 basix: main
68 ufl: main
69 ffcx: main
70 working-directory: ${{ env.working-directory}}
71
72 - name: Download legacy data
73 uses: actions/download-artifact@v5
74 with:
75 name: legacy_ompi
76 path: ./legacy
77
78 - name: Download legacy data
79 uses: actions/download-artifact@v5
80 with:
81 name: legacy_checkpoint_ompi
82 path: ./legacy_checkpoint
83
84 - name: Install package
85 run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} --check-build-dependencies .[test]
86
87 - name: Run tests
88 run: |
89 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests
90
91 - name: Run tests in parallel
92 run: |
93 mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests