-
Notifications
You must be signed in to change notification settings - Fork 11
338 lines (334 loc) · 11.6 KB
/
continuous_integration.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: Continuous Integration
on:
workflow_dispatch:
schedule:
- cron: "59 10 * * *" # 2 hrs after the nightly image build workflow
push:
pull_request_target:
types: [labeled, synchronize, opened]
permissions:
id-token: write
contents: read
pull-requests: write # For removing tags from the PR
defaults:
run:
shell: bash
jobs:
permission_check:
runs-on: ubuntu-latest
steps:
- name: Check for Actor Permission
id: check
continue-on-error: true
uses: prince-chrismc/check-actor-permissions-action@v2
with:
github_token: ${{ github.token }}
permission: write
- name: Check PR Safe to Run
if: ${{ github.event_name == 'pull_request_target' && (contains(github.event.pull_request.labels.*.name, 'safe to test') == 'false') && steps.check.outputs.permitted == 'false' }}
run: exit 1
- name: Remove Safe to Test Label # One commit is safe doesn't mean the next commit is safe.
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions-ecosystem/action-remove-labels@v1.3.0
with:
labels: 'safe to test'
cloud_lint_check:
needs: permission_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Cloud Lint Check
if: steps.changes.outputs.other_than_docs == 'true'
run: |
chmod +x ./.github/workflow_scripts/cloud_lint_check.sh && ./.github/workflow_scripts/cloud_lint_check.sh
test_general_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test General Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: general
ag_version: '${{ matrix.AG_VERSION }}'
test_tabular_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test Tabular Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: tabular
ag_version: '${{ matrix.AG_VERSION }}'
test_text_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test Text Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: text
ag_version: '${{ matrix.AG_VERSION }}'
test_image_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test Image Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: image
ag_version: '${{ matrix.AG_VERSION }}'
test_multimodal_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test Multimodal Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: multimodal
ag_version: '${{ matrix.AG_VERSION }}'
test_timeseries_cloud:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Test Timeseries Cloud
if: steps.changes.outputs.other_than_docs == 'true'
uses: ./.github/actions/test-cloud
with:
submodule-to-test: timeseries
ag_version: '${{ matrix.AG_VERSION }}'
test_cluster:
strategy:
fail-fast: false
matrix:
AG_VERSION: ["source", "1.1.0"]
needs: cloud_lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check if changes beside docs
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
other_than_docs:
- '!(docs/**)**'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::369469875935:role/CloudCluster
role-duration-seconds: 7200
aws-region: us-east-1
- name: Test Cluster
if: steps.changes.outputs.other_than_docs == 'true'
run: |
chmod +x ./.github/workflow_scripts/test_cluster.sh
./.github/workflow_scripts/test_cluster.sh '${{ matrix.AG_VERSION }}'
build_doc:
if: ${{ github.event_name != 'schedule' }}
needs: [test_general_cloud, test_tabular_cloud, test_text_cloud, test_image_cloud, test_multimodal_cloud, test_timeseries_cloud, test_cluster]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Env Vars
uses: ./.github/actions/setup-env-vars
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: r-lib/actions/setup-pandoc@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::369469875935:role/AutoGluonCloudCIDocRole
role-duration-seconds: 3600
aws-region: us-east-1
- name: Build Doc(For push)
if: ${{ github.event_name == 'push' }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh '${{ github.ref }}' '${{ github.repository }}' '${{ env.SHORT_SHA }}'
- name: Build Doc(For pull request)
if: ${{ github.event_name == 'pull_request_target' }}
env:
branch: ${{ github.event.pull_request.head.ref }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh "$branch" '${{ github.event.pull_request.head.repo.full_name }}' '${{ env.SHORT_SHA }}' PR-'${{ github.event.number }}'
- name: Comment on PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: peter-evans/create-or-update-comment@v2.0.0
with:
issue-number: ${{ github.event.number }}
body: |
Job PR-${{ github.event.number }}-${{ env.SHORT_SHA }} is done.
Docs are uploaded to https://d12sc05jpx1wj5.cloudfront.net/PR-${{ github.event.number }}/${{ env.SHORT_SHA }}/index.html