1
- name : pytest
1
+ name : Run tests
2
2
3
3
on :
4
- pull_request :
5
4
push :
6
- branches : [main]
7
- paths :
8
- - " .github/workflows/*"
9
- - " pymc_bart/**"
10
- - " setup.py"
11
- - " pyproject.toml"
12
- - " buildosx"
13
- - " conda-envs/**"
14
- - " codecov.yml"
5
+ branches :
6
+ - main
7
+ pull_request :
15
8
16
9
jobs :
17
- ubuntu :
10
+ test :
11
+ runs-on : ubuntu-latest
18
12
strategy :
19
13
matrix :
20
- os : [ubuntu-18.04]
21
- floatx : [float32, float64]
22
- fail-fast : false
23
- runs-on : ${{ matrix.os }}
24
- env :
25
- TEST_SUBSET : ${{ matrix.test-subset }}
26
- AESARA_FLAGS : floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
27
- defaults :
28
- run :
29
- shell : bash -l {0}
14
+ python-version : ["3.8", "3.9", "3.10"]
15
+
16
+ name : Set up Python ${{ matrix.python-version }}
30
17
steps :
31
18
- uses : actions/checkout@v2
32
- - name : Cache conda
33
- uses : actions/cache@v1
34
- env :
35
- # Increase this value to reset cache if environment-test-py38.yml has not changed
36
- CACHE_NUMBER : 0
37
- with :
38
- path : ~/conda_pkgs_dir
39
- key : ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
40
- hashFiles('conda-envs/environment-test-py38.yml') }}
41
- - name : Cache multiple paths
42
- uses : actions/cache@v2
43
- env :
44
- # Increase this value to reset cache if requirements.txt has not changed
45
- CACHE_NUMBER : 0
46
19
with :
47
- path : |
48
- ~/.cache/pip
49
- $RUNNER_TOOL_CACHE/Python/*
50
- ~\AppData\Local\pip\Cache
51
- key : ${{ runner.os }}-build-${{ matrix.python-version }}-${{
52
- hashFiles('requirements.txt') }}
53
- - uses : conda-incubator/setup-miniconda@v2
20
+ fetch-depth : 0
21
+
22
+ - name : Set up Python ${{ matrix.python-version }}
23
+ uses : conda-incubator/setup-miniconda@v2
54
24
with :
55
- miniforge-variant : Mambaforge
56
- miniforge-version : latest
57
- mamba-version : " *"
58
- activate-environment : pymc-test-py38
59
- channel-priority : strict
60
- environment-file : conda-envs/environment-test-py38.yml
61
- use-mamba : true
62
- use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
63
- - name : Install-pymc
25
+ channels : conda-forge, defaults
26
+ channel-priority : true
27
+ python-version : ${{ matrix.python-version }}
28
+ auto-update-conda : true
29
+
30
+ - name : Install pymc_bart
31
+ shell : bash -l {0}
64
32
run : |
65
- conda activate pymc-test-py38
66
- pip install -e .
33
+ conda install pip
34
+ pip install -r requirements-dev.txt
35
+ pip install .
67
36
python --version
37
+ conda list
38
+ pip freeze
39
+ - name : Run linters
40
+ shell : bash -l {0}
41
+ run : |
42
+ python -m black pymc_bart --check
43
+ echo "Success!"
44
+ # echo "Checking code style with pylint..."
45
+ # python -m pylint pymc_bart/
68
46
- name : Run tests
47
+ shell : bash -l {0}
69
48
run : |
70
- conda activate pymc-test-py38
71
- python -m pytest -vv --cov=pymc_bart --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
72
- - name : Upload coverage to Codecov
73
- uses : codecov/codecov-action@v2
74
- with :
75
- env_vars : TEST_SUBSET
76
- name : ${{ matrix.os }} ${{ matrix.floatx }}
77
- fail_ci_if_error : false
78
- windows :
79
- strategy :
80
- matrix :
81
- os : [windows-latest]
82
- floatx : [float32, float64]
83
- fail-fast : false
84
- runs-on : ${{ matrix.os }}
85
- env :
86
- TEST_SUBSET : ${{ matrix.test-subset }}
87
- AESARA_FLAGS : floatX=${{ matrix.floatx }},gcc__cxxflags='-march=core2'
88
- defaults :
89
- run :
90
- shell : cmd
91
- steps :
92
- - uses : actions/checkout@v2
93
- - name : Cache conda
94
- uses : actions/cache@v1
95
- env :
96
- # Increase this value to reset cache if conda-envs/environment-test-py37.yml has not changed
97
- CACHE_NUMBER : 0
98
- with :
99
- path : ~/conda_pkgs_dir
100
- key : ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
101
- hashFiles('conda-envs/windows-environment-test-py37.yml') }}
102
- - name : Cache multiple paths
103
- uses : actions/cache@v2
49
+ python -m pytest -vv --cov=pymc_bart --cov-report=term --cov-report=xml tests
104
50
env :
105
- # Increase this value to reset cache if requirements.txt has not changed
106
- CACHE_NUMBER : 0
107
- with :
108
- path : |
109
- ~/.cache/pip
110
- $RUNNER_TOOL_CACHE/Python/*
111
- ~\AppData\Local\pip\Cache
112
- key : ${{ runner.os }}-build-${{ matrix.python-version }}-${{
113
- hashFiles('requirements.txt') }}
114
- - uses : conda-incubator/setup-miniconda@v2
115
- with :
116
- miniforge-variant : Mambaforge
117
- miniforge-version : latest
118
- mamba-version : " *"
119
- activate-environment : pymc-test-py37
120
- channel-priority : strict
121
- environment-file : conda-envs/windows-environment-test-py37.yml
122
- use-mamba : true
123
- use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
124
- - name : Install-pymc
125
- run : |
126
- conda activate pymc-test-py37
127
- pip install -e .
128
- python --version
129
- - name : Run tests
130
- # This job uses a cmd shell, therefore the environment variable syntax is different!
131
- # The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
132
- run : >-
133
- conda activate pymc-test-py37 &&
134
- python -m pytest -vv --cov=pymc_bart --doctest-modules pymc_bart --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
51
+ PYTHON_VERSION : ${{ matrix.python-version }}
52
+
135
53
- name : Upload coverage to Codecov
136
- uses : codecov/codecov-action@v2
54
+ uses : codecov/codecov-action@v1
137
55
with :
138
- env_vars : TEST_SUBSET
139
- name : ${{ matrix.os }} ${{ matrix.floatx }}
140
- fail_ci_if_error : false
56
+ env_vars : OS,PYTHON
57
+ name : codecov-umbrella
58
+ fail_ci_if_error : false
0 commit comments