-
Notifications
You must be signed in to change notification settings - Fork 39
337 lines (316 loc) · 11.9 KB
/
ci.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
name: CI
on:
push:
branches-ignore:
- 'main'
- 'docs'
env:
BUILDER_VERSION: v0.9.46
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-java
LINUX_BASE_IMAGE: ubuntu-18-x64
RUN: ${{ github.run_id }}-${{ github.run_number }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_REGION: us-east-1
AWS_DEVICE_FARM_REGION: us-west-2 # Device Farm only available in us-west-2 region
jobs:
linux-compat:
runs-on: ubuntu-22.04 # latest
strategy:
matrix:
image:
- manylinux2014-x64
- manylinux2014-x86
- al2-x64
- fedora-34-x64
- opensuse-leap
- rhel8-x64
#- manylinux2014-x86 until we find 32-bit linux binaries we can use
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
linux-compiler-compat:
runs-on: ubuntu-22.04 # latest
strategy:
matrix:
compiler:
- clang-3
- clang-6
- clang-8
- clang-9
- clang-10
- clang-11
- gcc-4.8
- gcc-5
- gcc-6
- gcc-7
- gcc-8
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
linux-arm:
name: ARM (${{ matrix.arch }})
runs-on: ubuntu-22.04 # latest
strategy:
matrix:
arch: [armv6, armv7, arm64]
steps:
- name: Build ${{ env.PACKAGE_NAME }}
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
linux-musl:
runs-on: ubuntu-22.04 # latest
strategy:
matrix:
image:
- alpine-3.16-x64
- alpine-3.16-arm64
- openwrt-x64-openjdk8
steps:
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
# armv7 needs its own action due to inability to differentiate at runtime armv6 vs armv7 in the jvm:
#
# At build time we can properly figure out that we're targeting armv7.
# At run time we have to force armv7 (via environment variable) in order to achieve proper resource path
# resolution.
linux-musl-armv7:
runs-on: ubuntu-20.04 # latest
steps:
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }}
run: |
export AWS_CRT_ARCH=armv7
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-armv7 build -p ${{ env.PACKAGE_NAME }}
raspberry:
runs-on: ubuntu-22.04 # latest
strategy:
fail-fast: false
matrix:
image:
- raspbian-bullseye
steps:
# set arm arch
- name: Install qemu/docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ env.PACKAGE_NAME }}
run: |
aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
windows:
runs-on: windows-2022 # latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
windows-vc14:
runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0)
strategy:
matrix:
arch: [x86, x64]
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
env:
AWS_CMAKE_TOOLSET: v140
run: |
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
osx: # With integration tests
runs-on: macos-13 # latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
osx-arm64:
runs-on: macos-13 # latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
mvn -B compile -P mac-arm64
- name: verify backward compatibility
run: |
python3 codebuild/macos_compatibility_check.py armv8
osx-x64:
runs-on: macos-13
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
mvn -B compile -P mac-x64
- name: verify backward compatibility
run: |
python3 codebuild/macos_compatibility_check.py
android:
name: Android
runs-on: ubuntu-20.04 # latest
permissions:
# These permissions needed to interact with GitHub's OIDC Token endpoint
id-token: write # This is required for requesting the JWT
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
# Setup JDK 11
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Build ${{ env.PACKAGE_NAME }}
# Build and publish locally for the test app to find the SNAPSHOT version
run: |
./gradlew :android:crt:build
./gradlew :android:crt:publishToMavenLocal
- name: Run CRT Tests Locally
run: |
./gradlew test
- name: Setup Android Test Files
# Setup files and/or env variables required by the test app
# this is a TODO
run: |
pwd
- name: Build Test App
run: |
cd src/test/android/testapp
../../../../gradlew assembledebug
../../../../gradlew assembleAndroidTest
- name: Device Farm Tests
run: |
echo "Attempting to run python script"
python3 -m pip install boto3
python3 -m pip install requests
python3 ./.github/workflows/run_android_ci.py \
--run_id ${{ github.run_id }} \
--run_attempt ${{ github.run_attempt }} \
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\')
# check that docs can still build
check-docs:
runs-on: ubuntu-22.04 # latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Check docs
run: |
./make-docs.sh
check-submodules:
runs-on: ubuntu-22.04 # latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Check Submodules
# note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work
# https://github.com/actions/runner/issues/480
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main
localhost-test-linux:
runs-on: ubuntu-22.04 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python3 -m pip install h2
cd crt/aws-c-http/tests/py_localhost/
python3 server.py &
python3 non_tls_server.py &
- name: Build and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream
localhost-test-mac:
runs-on: macos-13 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python3 -m pip install h2
cd crt/aws-c-http/tests/py_localhost/
python3 server.py &
python3 non_tls_server.py &
- name: Build and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream
localhost-test-win:
runs-on: windows-2022 # latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure local host
run: |
python -m pip install h2
- name: Build and test
run: |
cd crt/aws-c-http/tests/py_localhost/
Start-Process -NoNewWindow python .\server.py
Start-Process -NoNewWindow python .\non_tls_server.py
python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} downstream