-
Notifications
You must be signed in to change notification settings - Fork 82
130 lines (126 loc) · 4.86 KB
/
test.yml
File metadata and controls
130 lines (126 loc) · 4.86 KB
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
name: pytest
on:
pull_request:
push:
branches: [main]
paths:
- ".github/workflows/*"
- "pymc_extras/**"
- "tests/**"
- "setup.py"
- "pyproject.toml"
- "conda-envs/**"
- "codecov.yml"
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
ubuntu:
strategy:
matrix:
os: [ubuntu-latest]
linker: [cvm, numba]
python-version: ["3.12"]
test-subset:
- tests/model
- tests/statespace/core/test_statespace.py
- tests/statespace/filters/test_kalman_filter.py
- tests/statespace --ignore tests/statespace/core/test_statespace.py --ignore tests/statespace/filters/test_kalman_filter.py
- tests/distributions
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions --ignore tests/pathfinder
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: linker=${{ matrix.linker }}
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-test.yml
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-extras-test
init-shell: bash
cache-environment: true
- name: Install pymc-extras
run: |
pip install -e ".[dev]"
pip install --no-deps --force-reinstall "pymc @ git+https://github.com/pymc-devs/pymc.git@v6"
pip install --no-deps --force-reinstall "pytensor @ git+https://github.com/pymc-devs/pytensor.git@v3"
pip install --no-deps --force-reinstall "preliz @ git+https://github.com/arviz-devs/preliz.git@main"
python --version
pip check
- name: Run tests
run: |
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }}
fail_ci_if_error: false
windows:
strategy:
matrix:
os: [windows-latest]
linker: [cvm, numba]
python-version: ["3.12"]
test-subset:
- tests/model
- tests/statespace/core/test_statespace.py
- tests/statespace/filters/test_kalman_filter.py
- tests/statespace --ignore tests/statespace/core/test_statespace.py --ignore tests/statespace/filters/test_kalman_filter.py
- tests/distributions
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions
fail-fast: false
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
PYTENSOR_FLAGS: linker=${{ matrix.linker }}
defaults:
run:
shell: cmd /C call {0}
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/environment-test.yml
micromamba-version: "latest"
create-args: >-
python=${{matrix.python-version}}
environment-name: pymc-extras-test
init-shell: cmd.exe
cache-environment: true
- name: Install pymc-extras
run: |
pip install -e ".[dev]"
pip install --no-deps --force-reinstall "pymc @ git+https://github.com/pymc-devs/pymc.git@v6"
pip install --no-deps --force-reinstall "pytensor @ git+https://github.com/pymc-devs/pytensor.git@v3"
pip install --no-deps --force-reinstall "preliz @ git+https://github.com/arviz-devs/preliz.git@main"
python --version
- name: Run tests
# This job uses a cmd shell, therefore the environment variable syntax is different!
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
run: >-
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: TEST_SUBSET
name: ${{ matrix.os }}
fail_ci_if_error: false
all_tests:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ ubuntu, windows ]
steps:
- name: Check all tests pass
if: ${{ needs.ubuntu.result != 'success' || needs.windows.result != 'success' }}
run: exit 1