forked from pyccel/psydac
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 4.61 KB
/
Copy pathtest-PR-struphy.yml
File metadata and controls
121 lines (102 loc) · 4.61 KB
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
111
112
113
114
115
116
117
118
119
120
121
name: PR - test Struphy in container
on:
pull_request:
branches: [devel-tiny]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
test_struphy:
runs-on: ubuntu-latest
container:
image: ghcr.io/struphy-hub/struphy/ubuntu-with-struphy:latest
credentials:
username: spossann
password: ${{ secrets.GHCR_PROJECT_TOKEN }}
strategy:
fail-fast: false
matrix:
# TODO: Make sure that struphy works with python > 3.11, keep the lower bound to 3.10
python-version: [ '3.12' ]
compile_language: ['c', 'fortran']
name: Test Struphy for Python ${{ matrix.python-version }} / ${{ matrix.compile_language }}
steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
- name: Checkout repo
uses: actions/checkout@v4
- name: Check .testmondata 1
run: |
ls .testmon* || echo "No .testmondata"
- name: Setup cache for testmon
uses: actions/cache@v4
with:
path: |
.testmondata-struphy-${{ matrix.compile_language }}
.testmondata-struphy-${{ matrix.compile_language }}-mpi
key: testmon-struphy-${{ matrix.compile_language }}-${{ github.ref_name }}-${{ github.event.number }}-${{ github.run_number }}
restore-keys: |
testmon-struphy-${{ matrix.compile_language }}-${{ github.ref_name }}-${{ github.event.number }}-
testmon-struphy-${{ matrix.compile_language }}-${{ github.ref_name }}
testmon-struphy-${{ matrix.compile_language }}-devel
testmon-struphy-${{ matrix.compile_language }}-
testmon-struphy-
- name: Check .testmondata 2
run: |
ls .testmon* || echo "No .testmondata"
- name: Install Psydac in container
uses: ./.github/actions/install/psydac-in-container
with:
compile_language: ${{ matrix.compile_language }}
- name: Compile all kernels
run: |
source /struphy_${{ matrix.compile_language }}_/env_${{ matrix.compile_language }}_/bin/activate
psydac-accelerate --language ${{ matrix.compile_language }}
# struphy compile --language ${{ matrix.compile_language }}
- name: Run struphy unit tests
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}
TEST_FILES: "bsplines/tests/ \
console/tests/ \
feec/tests/ \
fields_background/tests/ \
geometry/tests/ \
initial/tests/ \
kinetic_background/tests/ \
linear_algebra/tests/ \
ode/tests/ \
pic/tests/ \
polar/tests/ \
post_processing/tests/ \
propagators/tests/"
run: |
source /struphy_${{ matrix.compile_language }}_/env_${{ matrix.compile_language }}_/bin/activate
PYTHON=$(which python)
STRUPHY_PATH=$($PYTHON -c "import struphy; print(struphy.__path__[0])")
echo "Struphy is installed at: $STRUPHY_PATH"
echo "STRUPHY_PATH=${STRUPHY_PATH}" >> $GITHUB_ENV
mpirun -n 1 pytest -m single --testmon-forceselect -s --with-mpi --model-name Maxwell $STRUPHY_PATH
cd $STRUPHY_PATH
pytest --testmon $TEST_FILES
- name: Run struphy model tests
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}
run: |
source /struphy_${{ matrix.compile_language }}_/env_${{ matrix.compile_language }}_/bin/activate
pytest -m models --testmon-forceselect $STRUPHY_PATH/models/tests/default_params/
- name: Install mpi4py
run: |
source /struphy_${{ matrix.compile_language }}_/env_${{ matrix.compile_language }}_/bin/activate
pip install -U mpi4py
- name: Run struphy model tests with mpi
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}-mpi
run: |
source /struphy_${{ matrix.compile_language }}_/env_${{ matrix.compile_language }}_/bin/activate
mpirun -n 1 pytest -m single --testmon-forceselect -s --with-mpi --model-name Maxwell $STRUPHY_PATH
mpirun -oversubscribe -n 2 pytest -m models --testmon-forceselect --with-mpi $STRUPHY_PATH/models/tests/default_params/