-
Notifications
You must be signed in to change notification settings - Fork 1
195 lines (166 loc) · 6.04 KB
/
test-PR-pure-python.yml
File metadata and controls
195 lines (166 loc) · 6.04 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: PR - pure Python tests in Container
on:
pull_request:
branches:
- devel
schedule:
# run at 1 a.m. on Sunday
- cron: "0 1 * * 0"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
model-tests-in-container-with-reqs:
runs-on: ubuntu-latest
container:
image: ghcr.io/struphy-hub/struphy/ubuntu-with-reqs:latest
credentials:
username: spossann
password: ${{ secrets.GHCR_TOKEN }}
steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true # This is crucial!
fetch-depth: 5
- name: fetch origin devel
run: |
pwd
ls -a
git config --global --add safe.directory /__w/struphy/struphy
git fetch --no-tags origin devel:refs/remotes/origin/devel
git rev-parse --verify origin/devel
- name: Check .testmondata 1
run: |
ls .testmon* || echo "No .testmondata"
- name: Setup cache for testmon
uses: actions/cache@v4
with:
path: |
.testmondata-pure-python
.testmondata-pure-python-mpi
key: testmon-pure-python-${{ github.ref_name }}-${{ github.event.number }}-${{ github.run_number }}
restore-keys: |
testmon-pure-python-${{ github.ref_name }}-${{ github.event.number }}-
testmon-pure-python-${{ github.ref_name }}
testmon-pure-python-devel
testmon-pure-python-
- name: Check .testmondata 2
run: |
ls .testmon* || echo "No .testmondata"
- name: Install Struphy
uses: ./.github/actions/install/install-struphy
with:
env-name: env
- name: Get submodule diff
uses: ./.github/actions/submodule-diff
- name: Reinstall feectools from submodule
if: env.SUBMOD_CHANGED == 'true'
uses: ./.github/actions/install/feectools-submodule
with:
env-name: env
- name: Uncompile Struphy
shell: bash
run: |
source env/bin/activate
struphy compile -d
struphy compile --status
- name: MPI run check
shell: bash
run: |
source env/bin/activate
mpirun --version
mpirun --oversubscribe -n 1 python -c "from mpi4py import MPI; print('rank:', MPI.COMM_WORLD.rank); print('size:', MPI.COMM_WORLD.size)"
- name: Pytest-MPI plugin check
shell: bash
run: |
source env/bin/activate
pytest --trace-config | grep mpi || true
- name: Pytest with collect-only
shell: bash
run: |
source env/bin/activate
cd src/struphy
mpirun --oversubscribe -n 1 pytest --collect-only -q
- name: Manual LinearMHD test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy compile --status
mpirun --oversubscribe -n 1 pytest -m single -xvs --with-mpi --model-name LinearMHD $STRUPHY_PATH
- name: LinearMHD test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy compile --status
pytest -m single -xvs --model-name LinearMHD $STRUPHY_PATH
- name: Vlasov test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
pytest -m single -xvs --model-name Vlasov $STRUPHY_PATH
- name: GuidingCenter test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
pytest -m single -xvs --model-name GuidingCenter $STRUPHY_PATH
- name: VlasovAmpere test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
pytest -m single -xvs --model-name VlasovAmpereOneSpecies $STRUPHY_PATH
- name: ViscousEulerSPH test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
pytest -m single -xvs --model-name ViscousEulerSPH $STRUPHY_PATH
- name: Vlasov test MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi
# init .testmondata with non-MPI call
run: |
source env/bin/activate
mpirun -n 1 pytest -m single --testmon-forceselect -xs --with-mpi --model-name Maxwell $STRUPHY_PATH
mpirun -n 2 pytest -m single --testmon-forceselect -xs --with-mpi --model-name Vlasov $STRUPHY_PATH
- name: GuidingCenter test MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi
run: |
source env/bin/activate
mpirun -n 2 pytest -m single --testmon-forceselect -xs --with-mpi --model-name GuidingCenter $STRUPHY_PATH
- name: VlasovAmpere test MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi
run: |
source env/bin/activate
mpirun -n 2 pytest -m single --testmon-forceselect -xs --with-mpi --model-name VlasovAmpereOneSpecies $STRUPHY_PATH
- name: ViscousEulerSPH test MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi
run: |
source env/bin/activate
mpirun -n 2 pytest -m single --testmon-forceselect -xs --with-mpi --model-name ViscousEulerSPH $STRUPHY_PATH