-
Notifications
You must be signed in to change notification settings - Fork 31
116 lines (95 loc) · 2.57 KB
/
continuous-integration.yml
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
name: continuous-integration
on:
schedule:
- cron: '0 3 * * 0'
push:
branches:
- main
- io
pull_request:
branches:
- main
- io
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
mpi:
- mpich
- openmpi
py:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- os: macos-latest
py: "3.8"
steps:
- name: Configure hostname
if: runner.os == 'Linux' || runner.os == 'macOS'
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
- name: Checkout
uses: actions/checkout@v4
- name: Setup MPI (${{ matrix.mpi }})
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Use Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.os == 'macos-latest' && 'arm64' || 'x64' }}
- name: Install
run: python -m pip install .[mpi,test,ai] pytest-cov
- name: Test mpiexec_pod
run: mpiexec -n 2 python -m coverage run tests/test_pod_parallel.py
- name: Test mpiexec_spod
run: mpiexec -n 2 python -m coverage run tests/test_spod_parallel.py
- name: Test mpiexec_utils
run: mpiexec -n 2 python -m coverage run tests/test_utils_parallel.py
- name: Coverage combine
run: coverage combine
- name: Coverage report
run: coverage report
- name: Pytest --with-mpi
run: python -m pytest --cov=pyspod --cov-report=xml tests/ --with-mpi -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
test-no-mpi:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
py:
- "3.11"
- "3.12"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.os == 'macos-latest' && 'arm64' || 'x64' }}
- name: Install
run: python -m pip install .[test,ai]
- name: Test package
run: python -m pytest -v tests/