forked from aesara-devs/aesara
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (159 loc) · 5.61 KB
/
test.yml
File metadata and controls
169 lines (159 loc) · 5.61 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Tests
on:
push:
branches:
- master
- checks
pull_request:
branches:
- master
jobs:
changes:
name: "Check for changes"
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
python: &python
- 'theano/**/*.py'
- 'tests/**/*.py'
- '*.py'
src:
- *python
- '.github/**/*.yml'
- 'setup.cfg'
- 'requirements.txt'
- '.coveragerc'
style:
name: Check code style
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U black flake8 isort
- name: Check the style
run: |
black -t py36 --check theano/ tests/ setup.py conftest.py
isort --check theano/ tests/ setup.py conftest.py
flake8
test:
name: "Test py${{ matrix.python-version }}: ${{ matrix.part }}"
needs:
- changes
- style
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7"]
fast-compile: [0]
float32: [0]
part:
- "tests --ignore=tests/tensor --ignore=tests/sparse --ignore=tests/tensor/nnet"
- "tests/tensor tests/sparse --ignore=tests/tensor/test_basic.py --ignore=tests/tensor/test_basic_scipy.py --ignore=tests/tensor/test_inplace.py --ignore=tests/tensor/test_elemwise.py --ignore=tests/tensor/test_opt.py --ignore=tests/tensor/nnet"
- "tests/tensor/test_basic.py tests/tensor/test_basic_scipy.py tests/tensor/test_inplace.py"
- "tests/tensor/test_elemwise.py tests/tensor/test_opt.py"
- "tests/tensor/nnet --ignore-glob='*/test_abstract_conv.py'"
- "tests/tensor/nnet/test_abstract_conv.py"
include:
- python-version: "3.7"
fast-compile: 1
float32: 1
part: "tests --ignore=tests/tensor/nnet --ignore=tests/tensor/signal"
- python-version: "3.7"
fast-compile: 1
float32: 0
part: "tests --ignore=tests/tensor/nnet --ignore=tests/tensor/signal"
- python-version: "3.7"
fast-compile: 1
float32: 1
part: "tests/tensor/nnet"
- python-version: "3.7"
fast-compile: 1
float32: 0
part: "tests/tensor/nnet"
- python-version: "3.7"
fast-compile: 1
float32: 1
part: "tests/tensor/signal"
- python-version: "3.7"
fast-compile: 1
float32: 0
part: "tests/tensor/signal"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
python-version: ${{ matrix.python-version }}
auto-update-conda: true
- name: Get unique id
id: unique-id
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: |
echo $STRATEGY_CONTEXT
export JOB_ID=`echo $STRATEGY_CONTEXT | md5sum`
echo $JOB_ID
echo "::set-output name=id::$JOB_ID"
# Setup
- name: Install dependencies
shell: bash -l {0}
run: |
mamba install --yes -q mkl numpy scipy pip mkl-service graphviz cython libgpuarray pygpu
if [[ "$PYTHON_VERSION" != "3.6" ]]; then mamba install --yes -q -c conda-forge jax jaxlib; fi
pip install -q -r requirements.txt
mamba list && pip freeze
python -c 'import theano; print(theano.config.__str__(print_doc=False))'
python -c 'import theano; assert(theano.config.blas.ldflags != "")'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- name: Run tests
shell: bash -l {0}
run: |
if [[ $FAST_COMPILE == "1" ]]; then export THEANO_FLAGS=$THEANO_FLAGS,mode=FAST_COMPILE; fi
if [[ $FLOAT32 == "1" ]]; then export THEANO_FLAGS=$THEANO_FLAGS,floatX=float32; fi
export THEANO_FLAGS=$THEANO_FLAGS,warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc.cxxflags=-pipe
python -m pytest -x -r A --verbose --runslow --cov=theano/ --cov-report=xml --no-cov-on-fail $PART
env:
MKL_THREADING_LAYER: GNU
MKL_NUM_THREADS: 1
OMP_NUM_THREADS: 1
PART: ${{ matrix.part }}
FAST_COMPILE: ${{ matrix.fast-compile }}
FLOAT32: ${{ matrix.float32 }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
name: "py${{ matrix.python-version }}: ${{ matrix.part }}"
combine:
if: ${{ always() }}
runs-on: ubuntu-latest
name: "All tests"
needs: [changes, style, test]
steps:
- name: Check build matrix status
if: ${{ needs.changes.outputs.changes == 'true' && (needs.style.result != 'success' || needs.test.result != 'success') }}
run: exit 1