1- name : Run all checks for pull requests
1+ name : Run all checks
22
33on :
44 pull_request :
1111 required : false
1212 default : ' '
1313 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
1427
1528# Precompute the ref if the workflow was triggered by a workflow dispatch rather than copying this logic repeatedly
1629env :
1730 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 }}
1832
1933jobs :
2034 eval :
8599 - uses : actions/setup-python@v4
86100 name : Setup Python
87101 with :
88- python-version : 3.9
102+ python-version : ' 3.9'
89103 - run : python -m pip install --upgrade pip && pip install --upgrade setuptools
90104 name : Ensure latest pip and setuptools
91105 - run : ' pip install pycodestyle && pycodestyle econml'
@@ -103,11 +117,11 @@ jobs:
103117 extras : " [tf,plt]"
104118 pattern : " (?!CustomerScenarios)"
105119 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
107121 - kind : " customer-scenarios"
108122 extras : " [plt,dowhy]"
109123 pattern : " CustomerScenarios"
110- version : 3.9
124+ version : ' 3.9'
111125 install_graphviz : false
112126 fail-fast : false
113127 steps :
@@ -125,12 +139,22 @@ jobs:
125139 name : Install graphviz
126140 if : ${{ matrix.install_graphviz }}
127141 # 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' }}
129143 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+
134158 - run : python setup.py pytest
135159 name : Run notebook tests
136160 id : run_tests
@@ -156,16 +180,12 @@ jobs:
156180 strategy :
157181 matrix :
158182 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' ]
160184 kind : [serial, other, dml, main, treatment]
161185 exclude :
162186 # Serial tests fail randomly on mac sometimes, so we don't run them there
163187 - os : macos-latest
164188 kind : serial
165- # Python 3.6 isn't supported on ubuntu-latest
166- - os : ubuntu-latest
167- python-version : 3.6
168-
169189 # Assign the correct package and testing options for each kind of test
170190 include :
171191 - kind : serial
@@ -197,8 +217,15 @@ jobs:
197217 - run : python -m pip install --upgrade pip && pip install --upgrade setuptools
198218 name : Ensure latest pip and setuptools
199219 # 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' }}
201221 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
202229 - run : pip install pytest pytest-runner coverage
203230 name : Install pytest
204231 - run : python setup.py pytest
@@ -236,7 +263,7 @@ jobs:
236263 - uses : actions/setup-python@v4
237264 name : Setup Python
238265 with :
239- python-version : 3.8
266+ python-version : ' 3.8'
240267 - run : pip install coverage
241268 name : Install coverage
242269 - run : coverage combine coverage/
0 commit comments