-
Notifications
You must be signed in to change notification settings - Fork 86
210 lines (179 loc) · 6.12 KB
/
runtest.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: test
on: [pull_request] #, push]
jobs:
# Runs the tests on combinations of the supported python/os matrix.
test-code:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Get conda env file
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
cp .github/test_conda_env_macOS.yml .github/test_conda_env.yml
fi
- name: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -v -e . --no-deps
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
# - name: run all tests
# shell: bash -l {0}
# run: |
# py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
# export OMP_NUM_THREADS=2
# py.test -m "serial and not network" --cov-report=xml --cov-append
# py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: run main test suite
shell: bash -l {0}
run: |
py.test -n 2 -m "not serial and not network and not superslow and not slow" --cov-report=xml --dist loadscope
- name: run serial test
if: always()
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test -m "serial and not network" --cov-report=xml --cov-append
- name: run slow tests
if: always()
shell: bash -l {0}
run: |
py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
test-code-slow:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ['3.10']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e . --no-deps
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: run network tests
shell: bash -l {0}
run: |
py.test -n 2 -m "network and not superslow" --cov-report=xml
- name: run tutorials
if: always()
shell: bash -l {0}
run: |
py.test eqcorrscan/doc/tutorials/*.rst eqcorrscan/doc/submodules/*.rst --cov-report=xml --cov-append
- name: run superslow tests
if: always()
shell: bash -l {0}
run: |
py.test -m "superslow" -s eqcorrscan/tests/tutorials_test.py eqcorrscan/tests/subspace_test.py --cov-report=xml --cov-append
- name: upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
test-code-fmf:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ['3.9']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: eqcorrscan-test
use-mamba: true
- name: Update Env
run: mamba env update -n eqcorrscan-test -f .github/test_conda_env.yml
- name: install fmf
shell: bash -l {0}
run: |
cd ..
git clone https://github.com/beridel/fast_matched_filter.git
cd fast_matched_filter
pip install -e . --no-deps
cd ../EQcorrscan
- name: install eqcorrscan
shell: bash -l {0}
run: |
pip install -e .
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: run correlation test
shell: bash -l {0}
run: |
export OMP_NUM_THREADS=2
py.test eqcorrscan/tests/correlate_test.py --cov-report=xml
- name: upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
# This is a very useful step for debugging, it allows you to ssh into the CI
# machine (https://github.com/marketplace/actions/debugging-with-tmate).
# Make sure to open the log before the job starts else you cant see the tmate
# url. See https://github.com/mxschmitt/action-tmate/issues/1.
# Also, the CI machine will close on a non-zero exit code (annoying). This can
# be overcome by coalescing the null command like so:
# $ some-command-that-can-fail || :
#
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v1