|
5 | 5 | push:
|
6 | 6 | branches: [main]
|
7 | 7 |
|
| 8 | + |
| 9 | +# Tests are split into multiple jobs to accelerate the CI. |
| 10 | +# Different jobs should be organized to take approximately the same |
| 11 | +# time to complete (and not be prohibitely slow). |
| 12 | +# Because GitHub Actions don't support YAML anchors, we have to place the |
| 13 | +# splitting of testfiles into groups in the strategy/matrix/test-subset |
| 14 | +# and can't re-use the groups across jobs. |
| 15 | +# A pre-commit hook (scripts/check_all_tests_are_covered.py) |
| 16 | +# enforces that test run just once per OS / floatX setting. |
| 17 | + |
8 | 18 | jobs:
|
9 |
| - pytest: |
| 19 | + ubuntu: |
10 | 20 | strategy:
|
11 | 21 | matrix:
|
12 | 22 | os: [ubuntu-18.04]
|
13 | 23 | floatx: [float32, float64]
|
14 | 24 | test-subset:
|
15 |
| - # Tests are split into multiple jobs to accelerate the CI. |
16 |
| - # Different jobs should be organized to take approximately the same |
17 |
| - # time to complete (and not be prohibitely slow) |
18 |
| - # |
19 | 25 | # How this works:
|
20 | 26 | # 1st block: Only passes --ignore parameters to pytest.
|
21 | 27 | # → pytest will run all test_*.py files that are NOT ignored.
|
| 28 | + # |
22 | 29 | # Subsequent blocks: Only pass paths to test files.
|
23 | 30 | # → pytest will run only these files
|
24 |
| - # |
25 |
| - # Any test that was not ignored runs in the first job. |
26 |
| - # A pre-commit hook (scripts/check_all_tests_are_covered.py) |
27 |
| - # enforces that test run just once. |
28 | 31 | - |
|
29 | 32 | --ignore=pymc3/tests/test_distributions_timeseries.py
|
30 | 33 | --ignore=pymc3/tests/test_mixture.py
|
@@ -128,3 +131,55 @@ jobs:
|
128 | 131 | env_vars: OS,PYTHON
|
129 | 132 | name: codecov-umbrella
|
130 | 133 | fail_ci_if_error: false
|
| 134 | + windows: |
| 135 | + strategy: |
| 136 | + matrix: |
| 137 | + os: [windows-latest] |
| 138 | + floatx: [float64] |
| 139 | + test-subset: |
| 140 | + - pymc3/tests/test_distributions_random.py |
| 141 | + - pymc3/tests/test_sampling.py |
| 142 | + runs-on: ${{ matrix.os }} |
| 143 | + env: |
| 144 | + TEST_SUBSET: ${{ matrix.test-subset }} |
| 145 | + AESARA_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=core2' |
| 146 | + defaults: |
| 147 | + run: |
| 148 | + shell: bash -l {0} |
| 149 | + steps: |
| 150 | + - uses: actions/checkout@v2 |
| 151 | + - name: Cache conda |
| 152 | + uses: actions/cache@v1 |
| 153 | + env: |
| 154 | + # Increase this value to reset cache if conda-envs/environment-dev-py38.yml has not changed |
| 155 | + CACHE_NUMBER: 0 |
| 156 | + with: |
| 157 | + path: ~/conda_pkgs_dir |
| 158 | + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ |
| 159 | + hashFiles('conda-envs/windows-environment-dev-py38.yml') }} |
| 160 | + - name: Cache multiple paths |
| 161 | + uses: actions/cache@v2 |
| 162 | + env: |
| 163 | + # Increase this value to reset cache if requirements.txt has not changed |
| 164 | + CACHE_NUMBER: 0 |
| 165 | + with: |
| 166 | + path: | |
| 167 | + ~/.cache/pip |
| 168 | + $RUNNER_TOOL_CACHE/Python/* |
| 169 | + ~\AppData\Local\pip\Cache |
| 170 | + key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ |
| 171 | + hashFiles('requirements.txt') }} |
| 172 | + - uses: conda-incubator/setup-miniconda@v2 |
| 173 | + with: |
| 174 | + activate-environment: pymc3-dev-py38 |
| 175 | + channel-priority: strict |
| 176 | + environment-file: conda-envs/windows-environment-dev-py38.yml |
| 177 | + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! |
| 178 | + - name: Install-pymc3 |
| 179 | + run: | |
| 180 | + conda activate pymc3-dev-py38 |
| 181 | + pip install -e . |
| 182 | + python --version |
| 183 | + - run: | |
| 184 | + conda activate pymc3-dev-py38 |
| 185 | + python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET |
0 commit comments