File tree Expand file tree Collapse file tree 3 files changed +77
-8
lines changed Expand file tree Collapse file tree 3 files changed +77
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : jax-sampling
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches : [master]
7
+
8
+ jobs :
9
+ pytest :
10
+ strategy :
11
+ matrix :
12
+ os : [ubuntu-latest]
13
+ floatx : [float64]
14
+ test-subset :
15
+ - pymc3/tests/test_sampling_jax.py
16
+ fail-fast : false
17
+ runs-on : ${{ matrix.os }}
18
+ env :
19
+ TEST_SUBSET : ${{ matrix.test-subset }}
20
+ THEANO_FLAGS : floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
21
+ defaults :
22
+ run :
23
+ shell : bash -l {0}
24
+ steps :
25
+ - uses : actions/checkout@v2
26
+ - name : Cache conda
27
+ uses : actions/cache@v1
28
+ env :
29
+ # Increase this value to reset cache if environment-dev-py39.yml has not changed
30
+ CACHE_NUMBER : 0
31
+ with :
32
+ path : ~/conda_pkgs_dir
33
+ key : ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34
+ hashFiles('conda-envs/environment-dev-py39.yml') }}
35
+ - name : Cache multiple paths
36
+ uses : actions/cache@v2
37
+ env :
38
+ # Increase this value to reset cache if requirements.txt has not changed
39
+ CACHE_NUMBER : 0
40
+ with :
41
+ path : |
42
+ ~/.cache/pip
43
+ $RUNNER_TOOL_CACHE/Python/*
44
+ ~\AppData\Local\pip\Cache
45
+ key : ${{ runner.os }}-build-${{ matrix.python-version }}-${{
46
+ hashFiles('requirements.txt') }}
47
+ - uses : conda-incubator/setup-miniconda@v2
48
+ with :
49
+ activate-environment : pymc3-dev-py39
50
+ channel-priority : strict
51
+ environment-file : conda-envs/environment-dev-py39.yml
52
+ use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
53
+ - name : Install pymc3
54
+ run : |
55
+ conda activate pymc3-dev-py39
56
+ pip install -e .
57
+ python --version
58
+ - name : Install jax specific dependencies
59
+ run : |
60
+ conda activate pymc3-dev-py39
61
+ pip install numpyro tensorflow_probability
62
+ - name : Run tests
63
+ run : |
64
+ python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
Original file line number Diff line number Diff line change 27
27
--ignore=pymc3/tests/test_quadpotential.py
28
28
--ignore=pymc3/tests/test_random.py
29
29
--ignore=pymc3/tests/test_sampling.py
30
+ --ignore=pymc3/tests/test_sampling_jax.py
30
31
--ignore=pymc3/tests/test_shape_handling.py
31
32
--ignore=pymc3/tests/test_shared.py
32
33
--ignore=pymc3/tests/test_smc.py
Original file line number Diff line number Diff line change 12
12
from pathlib import Path
13
13
14
14
if __name__ == "__main__" :
15
- pytest_ci_job = Path (".github" ) / "workflows/pytest.yml"
16
- txt = pytest_ci_job .read_text ()
17
- ignored_tests = set (re .findall (r"(?<=--ignore=)(pymc3/tests.*\.py)" , txt ))
18
- non_ignored_tests = set (re .findall (r"(?<!--ignore=)(pymc3/tests.*\.py)" , txt ))
15
+ testing_workflows = ["jaxtests.yml" , "pytest.yml" ]
16
+ ignored = set ()
17
+ non_ignored = set ()
18
+ for wfyml in testing_workflows :
19
+ pytest_ci_job = Path (".github" ) / "workflows" / wfyml
20
+ txt = pytest_ci_job .read_text ()
21
+ ignored = set (re .findall (r"(?<=--ignore=)(pymc3/tests.*\.py)" , txt ))
22
+ non_ignored = non_ignored .union (set (re .findall (r"(?<!--ignore=)(pymc3/tests.*\.py)" , txt )))
19
23
assert (
20
- ignored_tests <= non_ignored_tests
21
- ), f"The following tests are ignored by the first job but not run by the others: { ignored_tests .difference (non_ignored_tests )} "
24
+ ignored <= non_ignored
25
+ ), f"The following tests are ignored by the first job but not run by the others: { ignored .difference (non_ignored )} "
22
26
assert (
23
- ignored_tests >= non_ignored_tests
24
- ), f"The following tests are run by multiple jobs: { non_ignored_tests .difference (ignored_tests )} "
27
+ ignored >= non_ignored
28
+ ), f"The following tests are run by multiple jobs: { non_ignored .difference (ignored )} "
You can’t perform that action at this time.
0 commit comments