Skip to content

Commit 8087861

Browse files
Combine test workflows
The steps within each job were not changed in this commit.
1 parent 0a9e99e commit 8087861

File tree

4 files changed

+147
-192
lines changed

4 files changed

+147
-192
lines changed

.github/workflows/arviz_compat.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/jaxtests.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.github/workflows/pytest.yml renamed to .github/workflows/tests.yml

Lines changed: 146 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pytest
1+
name: tests
22

33
on:
44
pull_request:
@@ -19,7 +19,6 @@ on:
1919
- "codecov.yml"
2020
- "scripts/*.sh"
2121

22-
2322
# Tests are split into multiple jobs to accelerate the CI.
2423
# Different jobs should be organized to take approximately the same
2524
# time to complete (and not be prohibitely slow).
@@ -249,3 +248,148 @@ jobs:
249248
env_vars: TEST_SUBSET
250249
name: ${{ matrix.os }} ${{ matrix.floatx }}
251250
fail_ci_if_error: false
251+
jax:
252+
strategy:
253+
matrix:
254+
os: [ubuntu-latest]
255+
floatx: [float64]
256+
test-subset:
257+
- pymc/tests/test_sampling_jax.py
258+
fail-fast: false
259+
runs-on: ${{ matrix.os }}
260+
env:
261+
TEST_SUBSET: ${{ matrix.test-subset }}
262+
AESARA_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
263+
defaults:
264+
run:
265+
shell: bash -l {0}
266+
steps:
267+
- uses: actions/checkout@v2
268+
- name: Cache conda
269+
uses: actions/cache@v1
270+
env:
271+
# Increase this value to reset cache if environment-test-py39.yml has not changed
272+
CACHE_NUMBER: 0
273+
with:
274+
path: ~/conda_pkgs_dir
275+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
276+
hashFiles('conda-envs/environment-test-py39.yml') }}
277+
- name: Cache multiple paths
278+
uses: actions/cache@v2
279+
env:
280+
# Increase this value to reset cache if requirements.txt has not changed
281+
CACHE_NUMBER: 0
282+
with:
283+
path: |
284+
~/.cache/pip
285+
$RUNNER_TOOL_CACHE/Python/*
286+
~\AppData\Local\pip\Cache
287+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
288+
hashFiles('requirements.txt') }}
289+
- uses: conda-incubator/setup-miniconda@v2
290+
with:
291+
miniforge-variant: Mambaforge
292+
miniforge-version: latest
293+
mamba-version: "*"
294+
activate-environment: pymc-test-py39
295+
channel-priority: strict
296+
environment-file: conda-envs/environment-test-py39.yml
297+
use-mamba: true
298+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
299+
- name: Install pymc
300+
run: |
301+
conda activate pymc-test-py39
302+
pip install -e .
303+
python --version
304+
- name: Install jax specific dependencies
305+
run: |
306+
conda activate pymc-test-py39
307+
pip install "numpyro>=0.8.0"
308+
pip install git+https://github.com/blackjax-devs/blackjax.git@main
309+
- name: Run tests
310+
run: |
311+
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
312+
- name: Upload coverage to Codecov
313+
uses: codecov/codecov-action@v2
314+
with:
315+
env_vars: TEST_SUBSET
316+
name: JAX tests - ${{ matrix.os }} ${{ matrix.floatx }}
317+
fail_ci_if_error: false
318+
arviz:
319+
strategy:
320+
matrix:
321+
os: [ubuntu-latest, macos-latest]
322+
floatx: [float64]
323+
test-subset:
324+
- |
325+
pymc/tests/test_parallel_sampling.py
326+
pymc/tests/test_posteriors.py
327+
pymc/tests/test_sampling.py
328+
329+
- |
330+
pymc/tests/test_data_container.py
331+
pymc/tests/test_idata_conversion.py
332+
pymc/tests/test_missing.py
333+
pymc/tests/test_model.py
334+
pymc/tests/test_shape_handling.py
335+
pymc/tests/test_shared.py
336+
fail-fast: false
337+
runs-on: ${{ matrix.os }}
338+
env:
339+
TEST_SUBSET: ${{ matrix.test-subset }}
340+
AESARA_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
341+
defaults:
342+
run:
343+
shell: bash -l {0}
344+
steps:
345+
- uses: actions/checkout@v2
346+
- name: Cache conda
347+
uses: actions/cache@v1
348+
env:
349+
# Increase this value to reset cache if environment-test-py39.yml has not changed
350+
CACHE_NUMBER: 0
351+
with:
352+
path: ~/conda_pkgs_dir
353+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
354+
hashFiles('conda-envs/environment-test-py39.yml') }}
355+
- name: Cache multiple paths
356+
uses: actions/cache@v2
357+
env:
358+
# Increase this value to reset cache if requirements.txt has not changed
359+
CACHE_NUMBER: 0
360+
with:
361+
path: |
362+
~/.cache/pip
363+
$RUNNER_TOOL_CACHE/Python/*
364+
~\AppData\Local\pip\Cache
365+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
366+
hashFiles('requirements.txt') }}
367+
- uses: conda-incubator/setup-miniconda@v2
368+
with:
369+
miniforge-variant: Mambaforge
370+
miniforge-version: latest
371+
mamba-version: "*"
372+
activate-environment: pymc-test-py39
373+
channel-priority: strict
374+
environment-file: conda-envs/environment-test-py39.yml
375+
use-mamba: true
376+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
377+
- name: Install pymc
378+
run: |
379+
conda activate pymc-test-py39
380+
pip install -e .
381+
python --version
382+
- name: Install latest arviz
383+
run: |
384+
conda activate pymc-test-py39
385+
pip uninstall arviz -y
386+
pip install git+https://github.com/arviz-devs/arviz
387+
- name: Run tests
388+
run: |
389+
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
390+
- name: Upload coverage to Codecov
391+
uses: codecov/codecov-action@v2
392+
with:
393+
env_vars: TEST_SUBSET
394+
name: ArviZ compat - ${{ matrix.os }} ${{ matrix.floatx }}
395+
fail_ci_if_error: false

scripts/check_all_tests_are_covered.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def from_yaml():
3636
"""
3737
# First collect the matrix definitions from testing workflows
3838
matrices = {}
39-
for wf in ["pytest.yml", "arviz_compat.yml", "jaxtests.yml"]:
39+
for wf in ["tests.yml"]:
4040
wfname = wf.strip(".yml")
4141
wfdef = yaml.safe_load(open(Path(".github", "workflows", wf)))
4242
for jobname, jobdef in wfdef["jobs"].items():

0 commit comments

Comments
 (0)