-
Notifications
You must be signed in to change notification settings - Fork 6
345 lines (296 loc) · 9.22 KB
/
sanity-test.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
339
340
341
342
343
344
345
name: Sanity Tests
on:
push:
branches-ignore:
- 'main'
paths:
- '.github/workflows/sanity-test.yml'
- 'builder/**'
- 'tests/**'
- '.github/actions/**/*'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
jobs:
cleanup:
name: Clean up previous branch jobs
runs-on: ubuntu-latest
steps:
- name: Clean up previous branch jobs
uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit_test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Run Tests
run: python3 -m unittest discover tests --verbose
package:
name: Package builder app
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Get release tag
uses: ./.github/actions/release-tag
id: tag
with:
output: tag
- run: echo TAG ${{ steps.tag.outputs.release_tag }}
# re-enable this when requirements.txt has actual dependencies
# - name: Bundle dependencies
# run: |
# python3 -m pip install -r requirements.txt --target builder
# rm -rf builder/*.dist-info
- name: Package builder to S3
run: |
mkdir -p build
mkdir -p staging
cp -r builder staging/.
python3 -m zipapp --python="/usr/bin/env python3" -m "builder.main:main" --output=build/builder.pyz staging
aws s3 cp build/builder.pyz s3://$AWS_S3_BUCKET/channels/${{ steps.tag.outputs.release_tag }}/builder.pyz
zipinfo -1 build/builder.pyz
- name: Artifact builder
uses: actions/upload-artifact@v3
with:
name: builder
path: build/builder.pyz
sanity_test:
name: Sanity Test
strategy:
fail-fast: false
matrix:
host: [ubuntu-22.04, macos-12, macos-13, macos-14, windows-2022]
needs: package
runs-on: ${{ matrix.host }}
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Sanity Test Run Compat (Unix)
if: ${{ !startsWith(matrix.host, 'windows') }}
run: |
ls -al
zipinfo -1 builder.pyz
python3 builder.pyz run test --project tests
- name: Sanity Test Action (Unix)
if: ${{ !startsWith(matrix.host, 'windows') }}
run: |
python3 builder.pyz test --project tests
- name: Sanity Test Build (Unix)
if: ${{ !startsWith(matrix.host, 'windows') }}
run: |
python3 builder.pyz build --project tests
- name: Sanity Test aws-c-common (Unix)
if: ${{ !startsWith(matrix.host, 'windows') }}
run: |
python3 builder.pyz build --project aws-c-common
- name: Sanity Test Run Compat (Windows)
if: startsWith(matrix.host, 'windows')
run: |
choco install --no-progress vswhere
python builder.pyz run test --project tests
- name: Sanity Test Action (Windows)
if: startsWith(matrix.host, 'windows')
run: |
choco install --no-progress vswhere
python builder.pyz test --project tests
- name: Sanity Test Build (Windows)
if: startsWith(matrix.host, 'windows')
run: |
python builder.pyz build --project tests
- name: Sanity Test aws-c-common (Windows)
if: startsWith(matrix.host, 'windows')
run: |
python builder.pyz build --project aws-c-common
# Make sure cross compiling works
cross_compile:
runs-on: ubuntu-latest
needs: [package]
strategy:
matrix:
arch: [linux-armv6, linux-armv7, linux-armv8]
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Build aws-crt-cpp + consumers
run: python3 builder.pyz build downstream -p aws-crt-cpp --target=${{matrix.arch}} --dump-config
# Make sure all the linux compilers work
compilers:
strategy:
fail-fast: false
matrix:
compiler:
# Note: 18.04 image is no longer supported by gh and 20.04 image does
# not have some of the old compilers we want. disable those for now
# until we figure out a way to test them.
# - clang-6
# - clang-7 # this one actually has to be installed by the script
# - clang-8
- clang-9
- clang-10
- clang-11
# - gcc-4.8
# - gcc-5
# - gcc-6
- gcc-7
- gcc-8
- gcc-9
- gcc-10
- gcc-11
needs: [package]
runs-on: ubuntu-20.04
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Build aws-c-common
run: python3 builder.pyz build --project aws-c-common --compiler=${{ matrix.compiler }} run_tests=false
# Make sure linux compilers + stdlibs are installing properly
std-compat:
needs: [package, sanity_test]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler: [gcc-8, clang-9]
std: [c++11, c++14, c++17, c++2a]
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Build aws-crt-cpp with ${{ matrix.compiler }}/${{ matrix.std }}
run: |
export CXXFLAGS=-std=${{ matrix.std }}
python3 builder.pyz build -p aws-crt-cpp --compiler=${{ matrix.compiler }}
release_notes:
strategy:
fail-fast: false
matrix:
project:
- aws-crt-python
- aws-iot-device-sdk-python-v2
needs: package
runs-on: ubuntu-latest
steps:
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Build ${{ matrix.project }}
run: python3 builder.pyz release-notes --project ${{ matrix.project }} --ignore-warnings
# Make sure downstream projects that use the builder compile after any changes
downstream:
strategy:
fail-fast: false
matrix:
project:
- aws-c-mqtt
- aws-c-http
- aws-crt-python
- aws-crt-cpp
- aws-crt-java
- aws-crt-nodejs
needs: package
runs-on: ubuntu-20.04
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install builder
uses: actions/download-artifact@v3
with:
name: builder
path: .
- name: Build ${{ matrix.project }}
run: python3 builder.pyz build --project ${{ matrix.project }} --compiler=clang
# This mostly tests that libcrypto and s2n resolve correctly on manylinux vs ubuntu
aws-c-cal:
strategy:
fail-fast: false
matrix:
linux:
- manylinux1-x86
- manylinux1-x64
- manylinux2014-x86
- manylinux2014-x64
- manylinux2014-aarch64
- musllinux-1-1-aarch64
- musllinux-1-1-x64
needs: package
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Get release tag
uses: ./.github/actions/release-tag
id: tag
with:
output: tag
# Only aarch64 needs this, but it doesn't hurt anything
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin
export DOCKER_IMAGE=${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.linux }}:${{ steps.tag.outputs.release_tag }}
docker pull $DOCKER_IMAGE
docker run --env GITHUB_REF $DOCKER_IMAGE --version=${{ steps.tag.outputs.release_tag }} build -p aws-c-cal --spec=downstream run_tests=false
# This tests for swift version
swift:
strategy:
fail-fast: false
matrix:
linux:
- swift-5-ubuntu-x64
- swift-5-centos-x64
- swift-5-al2-x64
needs: package
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Get release tag
uses: ./.github/actions/release-tag
id: tag
with:
output: tag
- name: Check for Swift
run: |
aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin
export DOCKER_IMAGE=${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.linux }}:${{ steps.tag.outputs.release_tag }}
docker pull $DOCKER_IMAGE
docker run --env GITHUB_REF --entrypoint swift $DOCKER_IMAGE --version
sanity-tests-passed:
name: All Sanity Tests passed
runs-on: ubuntu-latest
needs:
- unit_test
- sanity_test
- cross_compile
- compilers
- release_notes
steps:
- run: echo "All sanity tests passed"