7
7
branches : [main, develop]
8
8
9
9
concurrency :
10
- group : CI -${{ github.head_ref }}
11
- cancel-in-progress : true
10
+ group : ${{ github.event.repository.name }} -${{ github.ref }}-${{ github.workflow }}
11
+ cancel-in-progress : True
12
12
13
13
jobs :
14
14
test :
@@ -17,15 +17,42 @@ jobs:
17
17
fail-fast : false # true -> cancel all jobs if any fails
18
18
matrix :
19
19
python-version : ["3.8", "3.9", "3.10", "3.11"]
20
+ mpi : ['mpich','openmpi']
21
+ exclude :
22
+ - python-version : " 3.8"
23
+ mpi : ' mpich'
24
+ - python-version : " 3.9"
25
+ mpi : ' mpich'
20
26
21
27
steps :
22
- - uses : actions/checkout@v3
28
+ - name : Check out code
29
+ uses : actions/checkout@v3
30
+ with :
31
+ fetch-depth : 0
32
+
33
+ - name : Check for MPI tests with invalid rank count
34
+ run : |
35
+ python $GITHUB_WORKSPACE/helper_scripts/check-mpi-size.py
23
36
24
37
- name : Set up Python ${{ matrix.python-version }}
25
38
uses : actions/setup-python@v4
26
39
with :
27
40
python-version : ${{ matrix.python-version }}
28
41
42
+ - name : Setup MPI
43
+ uses : mpi4py/setup-mpi@v1
44
+ with :
45
+ mpi : ${{ matrix.mpi }}
46
+
47
+ - name : Install mpi4py
48
+ run : |
49
+ python -m pip install mpi4py
50
+
51
+ - name : Set Environment Variables
52
+ run : |
53
+ echo "OMPI_ALLOW_RUN_AS_ROOT=1" >> $GITHUB_ENV
54
+ echo "OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" >> $GITHUB_ENV
55
+
29
56
- name : Check environment
30
57
run : |
31
58
echo ======================================================
49
76
pip list
50
77
pip install .
51
78
52
- - name : Run tests
79
+ - name : Check Formatting (Pylint)
80
+ run : |
81
+ pip install pylint
82
+ pylint --recursive y --rcfile .pylintrc --output-format=colorized ./romtools
83
+ continue-on-error : false
84
+
85
+ - name : Run tests (Serial)
86
+ run : |
87
+ pytest --timeout=300
88
+
89
+ - name : Run tests (MPI, n=1)
90
+ run : |
91
+ mpirun -n 1 python -m pytest tests/romtools/* --with-mpi --timeout=300
92
+
93
+ - name : Run tests (MPI, n=3)
94
+ run : |
95
+ mpirun -n 3 python -m pytest tests/romtools/* --with-mpi --timeout=300
96
+
97
+ - name : Run tests (MPI, n=4)
53
98
run : |
54
- pytest -s
99
+ mpirun -n 4 python -m pytest tests/romtools/* --with-mpi --timeout=300
0 commit comments