@@ -3,24 +3,45 @@ on: [pull_request] #, push]
33
44jobs :
55 # Runs the tests on combinations of the supported python/os matrix.
6- test-code-macOS :
7- runs-on : " macos-latest "
6+ test-code :
7+ runs-on : ${{ matrix.os }}
88 strategy :
99 matrix :
10+ os : [ubuntu-latest, macos-latest, windows-latest]
1011 python-version : [3.7, 3.8]
1112 fail-fast : false
13+ # continue-on-error: true
1214
1315 steps :
1416 - uses : actions/checkout@v2
1517
18+ - name : Get conda env file
19+ shell : bash -l {0}
20+ run : |
21+ if [ "$RUNNER_OS" == "macOS" ]; then
22+ cp .github/test_conda_env_macOS.yml .github/test_conda_env.yml
23+ fi
24+
25+ - name : Cache conda
26+ uses : actions/cache@v2
27+ env :
28+ # Increase this value to reset cache if needed by env file has not changed
29+ CACHE_NUMBER : 0
30+ with :
31+ path : ~/conda_pkgs_dir
32+ key :
33+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34+ hashFiles('.github/test_conda_env.yml') }}
35+
1636 - name : Setup conda
1737 uses : conda-incubator/setup-miniconda@v2
1838 with :
1939 miniconda-version : ' latest'
2040 python-version : ${{ matrix.python-version }}
2141 activate-environment : eqcorrscan-test
22- environment-file : .github/test_conda_env_macOS .yml
42+ environment-file : .github/test_conda_env .yml
2343 condarc-file : .github/test_condarc.yml
44+ use-only-tar-bz2 : true # Must be set for caching to work properly
2445
2546 - name : install eqcorrscan
2647 shell : bash -l {0}
@@ -33,21 +54,32 @@ jobs:
3354 conda info -a
3455 conda list
3556
57+ # - name: run all tests
58+ # shell: bash -l {0}
59+ # run: |
60+ # py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
61+ # export OMP_NUM_THREADS=2
62+ # py.test -m "serial and not network" --cov-report=xml --cov-append
63+ # py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
64+
3665 - name : run main test suite
3766 shell : bash -l {0}
38- continue-on-error : true
3967 run : |
4068 py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
41- - name : run slow tests
42- shell : bash -l {0}
43- run : |
44- py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
69+
4570 - name : run serial test
71+ if : always()
4672 shell : bash -l {0}
4773 run : |
4874 export OMP_NUM_THREADS=2
4975 py.test -m "serial and not network" --cov-report=xml --cov-append
5076
77+ - name : run slow tests
78+ if : always()
79+ shell : bash -l {0}
80+ run : |
81+ py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
82+
5183 - name : upload coverage
5284 uses : codecov/codecov-action@v1
5385 with :
@@ -58,16 +90,28 @@ jobs:
5890 yml : ./codecov.yml
5991 fail_ci_if_error : true
6092
61- test-code-ubuntu :
93+
94+ test-code-slow :
6295 runs-on : " ubuntu-latest"
6396 strategy :
6497 matrix :
65- python-version : [3.7, 3. 8]
98+ python-version : [3.8]
6699 fail-fast : false
67100
68101 steps :
69102 - uses : actions/checkout@v2
70103
104+ - name : Cache conda
105+ uses : actions/cache@v2
106+ env :
107+ # Increase this value to reset cache if needed by env file has not changed
108+ CACHE_NUMBER : 0
109+ with :
110+ path : ~/conda_pkgs_dir
111+ key :
112+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
113+ hashFiles('.github/test_conda_env.yml') }}
114+
71115 - name : Setup conda
72116 uses : conda-incubator/setup-miniconda@v2
73117 with :
76120 activate-environment : eqcorrscan-test
77121 environment-file : .github/test_conda_env.yml
78122 condarc-file : .github/test_condarc.yml
123+ use-only-tar-bz2 : true # Must be set for caching to work properly
79124
80125 - name : install eqcorrscan
81126 shell : bash -l {0}
@@ -88,19 +133,20 @@ jobs:
88133 conda info -a
89134 conda list
90135
91- - name : run main test suite
136+ - name : run network tests
92137 shell : bash -l {0}
93138 run : |
94- py.test -n 2 -m "not serial and not network and not superslow" --cov-report=xml
95- - name : run slow tests
139+ py.test -n 2 -m "network" --cov-report=xml
140+ - name : run tutorials
141+ if : always()
96142 shell : bash -l {0}
97143 run : |
98- py.test -v -m "slow and not serial and not network" --cov-report=xml --cov-append
99- - name : run serial test
144+ py.test eqcorrscan/doc/tutorials/*.rst eqcorrscan/doc/submodules/*.rst --cov-report=xml --cov-append
145+ - name : run superslow tests
146+ if : always()
100147 shell : bash -l {0}
101148 run : |
102- export OMP_NUM_THREADS=2
103- py.test -m "serial and not network" --cov-report=xml --cov-append
149+ py.test -m "superslow" -s eqcorrscan/tests/tutorials_test.py eqcorrscan/tests/subspace_test.py --cov-report=xml --cov-append
104150
105151 - name : upload coverage
106152 uses : codecov/codecov-action@v1
0 commit comments