forked from pyccel/psydac
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (93 loc) · 3.7 KB
/
test-struphy.yml
File metadata and controls
112 lines (93 loc) · 3.7 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
name: Test struphy
on:
push:
branches: [devel-tiny]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_struphy:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.12' ]
compile_language: ['c', 'fortran']
name: Test Struphy on ${{ matrix.os }} / Python ${{ matrix.python-version }} / ${{ matrix.compile_language }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up environment variables
run: |
echo "PSYDAC_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "STRUPHY_DIR=$GITHUB_WORKSPACE/struphy" >> $GITHUB_ENV
- 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 prerequisites
uses: ./.github/actions/install/psydac-req
- name: Install project without mpi
run: |
python -m pip install ".[test]" --no-cache-dir
python -m pip freeze
- name: Clone struphy from Github
run: |
git clone https://github.com/struphy-hub/struphy.git $STRUPHY_DIR
- name: Install struphy without mpi #TODO: Set branch to devel
working-directory: ${{ env.STRUPHY_DIR }}
run: |
pip show feectools
pip uninstall feectools -y
python -m pip install ".[phys]" --no-cache-dir
echo "feectools location after installing struphy"
pip show feectools
- name: Re-install feectools from the current branch
run: |
psydac-accelerate --cleanup --yes
pip show feectools
pip uninstall feectools -y
python -m pip install ${{ env.PSYDAC_DIR }} --force-reinstall --no-cache-dir
echo "feectools location after installing feectools from the current branch (should be the same as in the previous step)"
pip show feectools
- name: Compile struphy
run: |
pip show feectools
struphy -h
struphy compile -y --language ${{ matrix.compile_language }}
- name: Run struphy unit tests
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}
run: |
struphy test unit
- name: Run struphy model tests
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}
run: |
struphy test models
- name: Install mpi4py
run: |
pip install -U mpi4py
- name: Run struphy model tests with mpi
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-struphy-${{ matrix.compile_language }}-mpi
run: |
struphy test Maxwell
struphy test models --mpi 2