• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5    branches-ignore:
6      - 'main'
7      - 'docs'
8
9env:
10  BUILDER_VERSION: v0.9.54
11  BUILDER_SOURCE: releases
12  BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
13  PACKAGE_NAME: aws-crt-java
14  LINUX_BASE_IMAGE: ubuntu-18-x64
15  RUN: ${{ github.run_id }}-${{ github.run_number }}
16  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
17  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18  AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
19  AWS_REGION: us-east-1
20  AWS_DEVICE_FARM_REGION: us-west-2 # Device Farm only available in us-west-2 region
21
22jobs:
23  linux-compat:
24    runs-on: ubuntu-22.04 # latest
25    strategy:
26      matrix:
27        image:
28          - manylinux2014-x64
29          - manylinux2014-x86
30          - al2-x64
31          - fedora-34-x64
32          - opensuse-leap
33          - rhel8-x64
34          #- manylinux2014-x86 until we find 32-bit linux binaries we can use
35    steps:
36      - name: Checkout Sources
37        uses: actions/checkout@v3
38        with:
39          submodules: true
40      - name: Build ${{ env.PACKAGE_NAME }}
41        run: |
42          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
43          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
44
45  linux-compiler-compat:
46    runs-on: ubuntu-22.04 # latest
47    strategy:
48      matrix:
49        compiler:
50          - clang-3
51          - clang-6
52          - clang-8
53          - clang-9
54          - clang-10
55          - clang-11
56          - gcc-4.8
57          - gcc-5
58          - gcc-6
59          - gcc-7
60          - gcc-8
61    steps:
62      - name: Checkout Sources
63        uses: actions/checkout@v3
64        with:
65          submodules: true
66      - name: Build ${{ env.PACKAGE_NAME }}
67        run: |
68          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
69          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }}
70
71  linux-arm:
72    name: ARM (${{ matrix.arch }})
73    runs-on: ubuntu-22.04 # latest
74    strategy:
75      matrix:
76        arch: [armv6, armv7, arm64]
77    steps:
78      - name: Build ${{ env.PACKAGE_NAME }}
79        run: |
80          python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
81          chmod a+x builder
82          ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
83
84  linux-musl:
85    runs-on: ubuntu-22.04 # latest
86    strategy:
87      matrix:
88        image:
89          - alpine-3.16-x64
90          - alpine-3.16-arm64
91          - openwrt-x64-openjdk8
92    steps:
93      - name: Install qemu/docker
94        run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
95      - name: Checkout Sources
96        uses: actions/checkout@v2
97        with:
98          submodules: true
99      - name: Build ${{ env.PACKAGE_NAME }}
100        run: |
101          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
102          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
103
104  # armv7 needs its own action due to inability to differentiate at runtime armv6 vs armv7 in the jvm:
105  #
106  # At build time we can properly figure out that we're targeting armv7.
107  # At run time we have to force armv7 (via environment variable) in order to achieve proper resource path
108  # resolution.
109  linux-musl-armv7:
110    runs-on: ubuntu-20.04 # latest
111    steps:
112      - name: Install qemu/docker
113        run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
114      - name: Checkout Sources
115        uses: actions/checkout@v2
116        with:
117          submodules: true
118      - name: Build ${{ env.PACKAGE_NAME }}
119        run: |
120          export AWS_CRT_ARCH=armv7
121          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
122          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-alpine-3.16-armv7 build -p ${{ env.PACKAGE_NAME }}
123
124  raspberry:
125    runs-on: ubuntu-22.04 # latest
126    strategy:
127      fail-fast: false
128      matrix:
129        image:
130          - raspbian-bullseye
131    steps:
132    # set arm arch
133    - name: Install qemu/docker
134      run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
135    - name: Build ${{ env.PACKAGE_NAME }}
136      run: |
137        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
138        ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
139
140
141  windows:
142    runs-on: windows-2022 # latest
143    steps:
144      - name: Checkout Sources
145        uses: actions/checkout@v3
146        with:
147          submodules: true
148      - name: Build ${{ env.PACKAGE_NAME }} + consumers
149        run: |
150          python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
151          python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
152
153  windows-vc14:
154    runs-on: windows-2019 # windows-2019 is last env with Visual Studio 2015 (v14.0)
155    strategy:
156      matrix:
157        arch: [x86, x64]
158    steps:
159      - name: Checkout Sources
160        uses: actions/checkout@v3
161        with:
162          submodules: true
163      - name: Build ${{ env.PACKAGE_NAME }} + consumers
164        env:
165          AWS_CMAKE_TOOLSET: v140
166        run: |
167          python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
168          python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
169
170  osx:  # With integration tests
171    runs-on: macos-13 # latest
172    steps:
173      - name: Checkout Sources
174        uses: actions/checkout@v3
175        with:
176          submodules: true
177      - name: Build ${{ env.PACKAGE_NAME }} + consumers
178        run: |
179          python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
180          chmod a+x builder
181          ./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
182
183  osx-arm64:
184    runs-on: macos-13 # latest
185    steps:
186      - name: Checkout Sources
187        uses: actions/checkout@v3
188        with:
189          submodules: true
190      - name: Build ${{ env.PACKAGE_NAME }} + consumers
191        run: |
192          mvn -B compile -P mac-arm64
193      - name: verify backward compatibility
194        run: |
195          python3 codebuild/macos_compatibility_check.py armv8
196
197  osx-x64:
198    runs-on: macos-13
199    steps:
200      - name: Checkout Sources
201        uses: actions/checkout@v2
202        with:
203          submodules: true
204      - name: Build ${{ env.PACKAGE_NAME }} + consumers
205        run: |
206          mvn -B compile -P mac-x64
207      - name: verify backward compatibility
208        run: |
209          python3 codebuild/macos_compatibility_check.py
210
211  android:
212      # ubuntu-20.04 comes with Android tooling, see:
213      # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#android
214    name: Android
215    runs-on: ubuntu-20.04 # latest
216    steps:
217      - name: Checkout Sources
218        uses: actions/checkout@v2
219        with:
220            submodules: true
221      # Setup JDK 11
222      - name: set up JDK 11
223        uses: actions/setup-java@v3
224        with:
225          java-version: '11'
226          distribution: 'temurin'
227          cache: 'gradle'
228      # Build and publish locally for the test app to find the SNAPSHOT version
229      - name: Build ${{ env.PACKAGE_NAME }}
230        run: |
231          ./gradlew :android:crt:build
232          ./gradlew -PnewVersion="1.0.0-SNAPSHOT" :android:crt:publishToMavenLocal
233      # Setup files required by test app for Device Farm testing
234      - name: Setup Android Test Files
235        run: |
236          cd src/test/android/testapp/src/main/assets
237          python3 -m pip install boto3
238          python3 ./android_file_creation.py
239      - name: Build Test App
240        run: |
241          cd src/test/android/testapp
242          ../../../../gradlew assembledebug
243          ../../../../gradlew assembleAndroidTest
244      - name: Device Farm Tests
245        run: |
246          echo "Running Device Farm Python Script"
247          python3 ./.github/workflows/run_android_ci.py \
248          --run_id ${{ github.run_id }} \
249          --run_attempt ${{ github.run_attempt }} \
250          --project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
251          --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'\')
252
253  # check that docs can still build
254  check-docs:
255    runs-on: ubuntu-22.04 # latest
256    steps:
257      - uses: actions/checkout@v3
258        with:
259          submodules: true
260      - name: Check docs
261        run: |
262          ./make-docs.sh
263
264  check-submodules:
265    runs-on: ubuntu-22.04 # latest
266    steps:
267      - name: Checkout Source
268        uses: actions/checkout@v3
269        with:
270          submodules: true
271          fetch-depth: 0
272      - name: Check Submodules
273        # note: using "@main" because "@${{env.BUILDER_VERSION}}" doesn't work
274        # https://github.com/actions/runner/issues/480
275        uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main
276
277
278  localhost-test-linux:
279    runs-on: ubuntu-22.04 # latest
280    steps:
281    - name: Checkout
282      uses: actions/checkout@v3
283      with:
284        submodules: true
285    - name: Configure local host
286      run: |
287        python3 -m pip install h2
288        cd crt/aws-c-http/tests/py_localhost/
289        python3 server.py &
290        python3 non_tls_server.py &
291    - name: Build and test
292      run: |
293        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
294        python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream
295
296  localhost-test-mac:
297    runs-on: macos-13 # latest
298    steps:
299    - name: Checkout
300      uses: actions/checkout@v3
301      with:
302        submodules: true
303    - name: Configure local host
304      run: |
305        python3 -m pip install h2
306        cd crt/aws-c-http/tests/py_localhost/
307        python3 server.py &
308        python3 non_tls_server.py &
309    - name: Build and test
310      run: |
311        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
312        chmod a+x builder
313        ./builder localhost-test -p ${{ env.PACKAGE_NAME }} --spec=downstream
314
315  localhost-test-win:
316    runs-on: windows-2022 # latest
317    steps:
318    - name: Checkout
319      uses: actions/checkout@v3
320      with:
321        submodules: true
322    - name: Configure local host
323      run: |
324        python -m pip install h2
325    - name: Build and test
326      run: |
327        cd crt/aws-c-http/tests/py_localhost/
328        Start-Process -NoNewWindow python .\server.py
329        Start-Process -NoNewWindow python .\non_tls_server.py
330        python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
331        python builder.pyz localhost-test -p ${{ env.PACKAGE_NAME }} downstream
332