1
- name : Run all checks for pull requests
1
+ name : Run all checks
2
2
3
3
on :
4
4
pull_request :
11
11
required : false
12
12
default : ' '
13
13
type : string
14
+ use_lkg :
15
+ description : ' Whether to use the last known good versions of dependencies'
16
+ required : true
17
+ default : True
18
+ type : boolean
19
+ # nightly
20
+ schedule :
21
+ - cron : ' 0 0 * * *'
22
+
23
+ # Only run once per PR, canceling any previous runs
24
+ concurrency :
25
+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
26
+ cancel-in-progress : true
14
27
15
28
# Precompute the ref if the workflow was triggered by a workflow dispatch rather than copying this logic repeatedly
16
29
env :
17
30
ref : ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }}
31
+ use_lkg : ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg || github.event_name == 'pull_request') || null }}
18
32
19
33
jobs :
20
34
eval :
85
99
- uses : actions/setup-python@v4
86
100
name : Setup Python
87
101
with :
88
- python-version : 3.9
102
+ python-version : ' 3.9'
89
103
- run : python -m pip install --upgrade pip && pip install --upgrade setuptools
90
104
name : Ensure latest pip and setuptools
91
105
- run : ' pip install pycodestyle && pycodestyle econml'
@@ -103,11 +117,11 @@ jobs:
103
117
extras : " [tf,plt]"
104
118
pattern : " (?!CustomerScenarios)"
105
119
install_graphviz : true
106
- version : 3.8 # no supported version of tensorflow for 3.9
120
+ version : ' 3.8' # no supported version of tensorflow for 3.9
107
121
- kind : " customer-scenarios"
108
122
extras : " [plt,dowhy]"
109
123
pattern : " CustomerScenarios"
110
- version : 3.9
124
+ version : ' 3.9'
111
125
install_graphviz : false
112
126
fail-fast : false
113
127
steps :
@@ -125,12 +139,22 @@ jobs:
125
139
name : Install graphviz
126
140
if : ${{ matrix.install_graphviz }}
127
141
# Add verbose flag to pip installation if in debug mode
128
- - run : pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }}
142
+ - run : pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }} ${{ env.use_lkg && '-r lkg-notebook.txt' }}
129
143
name : Install econml
130
- - run : pip install pytest pytest-runner coverage jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm
131
- name : Install test and notebook requirements
132
- - run : pip list
133
- name : List installed packages
144
+ # Install notebook requirements (if not already done as part of lkg)
145
+ - run : pip install jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm
146
+ name : Install notebook requirements
147
+ if : ${{ !env.use_lkg }}
148
+ - run : pip freeze --exclude-editable > notebooks-${{ matrix.version }}-${{ matrix.kind }}-requirements.txt
149
+ name : Save installed packages
150
+ - uses : actions/upload-artifact@v3
151
+ name : Upload installed packages
152
+ with :
153
+ name : requirements
154
+ path : notebooks-${{ matrix.version }}-${{ matrix.kind }}-requirements.txt
155
+ - run : pip install pytest pytest-runner coverage
156
+ name : Install pytest
157
+
134
158
- run : python setup.py pytest
135
159
name : Run notebook tests
136
160
id : run_tests
@@ -156,16 +180,12 @@ jobs:
156
180
strategy :
157
181
matrix :
158
182
os : [ubuntu-latest, windows-latest, macos-latest]
159
- python-version : [3.6, 3.7, 3.8, 3.9 ]
183
+ python-version : ['3.7', '3.8', '3.9', '3.10' ]
160
184
kind : [serial, other, dml, main, treatment]
161
185
exclude :
162
186
# Serial tests fail randomly on mac sometimes, so we don't run them there
163
187
- os : macos-latest
164
188
kind : serial
165
- # Python 3.6 isn't supported on ubuntu-latest
166
- - os : ubuntu-latest
167
- python-version : 3.6
168
-
169
189
# Assign the correct package and testing options for each kind of test
170
190
include :
171
191
- kind : serial
@@ -197,8 +217,15 @@ jobs:
197
217
- run : python -m pip install --upgrade pip && pip install --upgrade setuptools
198
218
name : Ensure latest pip and setuptools
199
219
# Add verbose flag to pip installation if in debug mode
200
- - run : pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }}
220
+ - run : pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }} ${{ env.use_lkg && '-r lkg.txt' }}
201
221
name : Install econml
222
+ - run : pip freeze --exclude-editable > tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}-requirements.txt
223
+ name : Save installed packages
224
+ - uses : actions/upload-artifact@v3
225
+ name : Upload installed packages
226
+ with :
227
+ name : requirements
228
+ path : tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}-requirements.txt
202
229
- run : pip install pytest pytest-runner coverage
203
230
name : Install pytest
204
231
- run : python setup.py pytest
@@ -236,7 +263,7 @@ jobs:
236
263
- uses : actions/setup-python@v4
237
264
name : Setup Python
238
265
with :
239
- python-version : 3.8
266
+ python-version : ' 3.8'
240
267
- run : pip install coverage
241
268
name : Install coverage
242
269
- run : coverage combine coverage/
0 commit comments