forked from pymc-labs/pymc-marketing
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (67 loc) · 2.24 KB
/
test.yml
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
name: Test
on:
pull_request:
branches: [main]
paths: '**.py'
push:
branches: [main]
paths: '**.py'
env:
# The lower bound from the pyproject.toml file
OLDEST_PYMC_VERSION: "$(grep -E 'pymc *>' pyproject.toml | sed -n 's/.*>=\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*/\\1/p')"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
config: [ {python-version: "3.10", oldest-pymc: false}, {python-version: "3.12", oldest-pymc: true}]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config.python-version }}
- name: Install oldest version of PyMC
if: ${{ matrix.config.oldest-pymc }}
run: pip install pymc==${{ env.OLDEST_PYMC_VERSION }}
- name: Run tests
run: |
sudo apt-get install graphviz
pip install -e .[test]
pytest --cov-report=xml --no-cov-on-fail --durations=50
- name: Check oldest version of PyMC
if: ${{ matrix.config.oldest-pymc }}
run: python -c "import pymc; assert pymc.__version__ == '${{ env.OLDEST_PYMC_VERSION }}'"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
name: ${{ matrix.config.python-version }}
fail_ci_if_error: false
test_slow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Run tests
run: |
pip install -e .[test]
pytest --only-slow --cov-report=xml --no-cov-on-fail --durations=50
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # use token for more robust uploads
name: "test_slow"
fail_ci_if_error: false
all:
if: ${{ always() }}
runs-on: ubuntu-latest
name: All checks
needs: [ test, test_slow ]
steps:
- name: Confirm checks passed
if: ${{ (needs.test.result != 'success' || needs.test_slow.result != 'success') }}
run: exit 1