Skip to content

Commit b6e66af

Browse files
committed
split out slow ci jobs and android into their own workflows
1 parent 52184d5 commit b6e66af

3 files changed

Lines changed: 209 additions & 156 deletions

File tree

.github/workflows/ci-android.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: CI Android
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'main'
7+
- 'docs'
8+
9+
# cancel in-progress builds after a new commit
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
BUILDER_VERSION: v0.9.84
16+
BUILDER_SOURCE: releases
17+
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
18+
PACKAGE_NAME: aws-crt-java
19+
RUN: ${{ github.run_id }}-${{ github.run_number }}
20+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
21+
AWS_DEFAULT_REGION: us-east-1
22+
AWS_REGION: us-east-1
23+
AWS_DEVICE_FARM_REGION: us-west-2 # Device Farm only available in us-west-2 region
24+
25+
permissions:
26+
id-token: write # This is required for requesting the JWT
27+
28+
jobs:
29+
android:
30+
# ubuntu-24.04 comes with Android tooling
31+
name: Android
32+
runs-on: ubuntu-24.04 # latest
33+
steps:
34+
- uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
role-to-assume: ${{ env.CRT_CI_ROLE }}
37+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
38+
- name: Checkout Sources
39+
uses: actions/checkout@v4
40+
with:
41+
submodules: true
42+
# Setup JDK 17
43+
- name: set up JDK 17
44+
uses: actions/setup-java@v4
45+
with:
46+
java-version: '17'
47+
distribution: 'temurin'
48+
# Ensure Gradle uses this JDK (important when toolchains are present)
49+
- name: Point Gradle at JDK 17
50+
run: echo "ORG_GRADLE_JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
51+
52+
- name: Mirror ANDROID_HOME → ANDROID_SDK_ROOT
53+
run: echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> "$GITHUB_ENV"
54+
55+
# Install required Android components & accept licenses (NDK r28 + compileSdk 35)
56+
- name: Install Android SDK packages
57+
shell: bash
58+
run: |
59+
set -euo pipefail
60+
SDKROOT="${ANDROID_SDK_ROOT:-$ANDROID_HOME}"
61+
SDKMANAGER="$SDKROOT/cmdline-tools/latest/bin/sdkmanager"
62+
63+
# Some images have cmdline-tools already; ensure path exists
64+
if [[ ! -x "$SDKMANAGER" ]]; then
65+
echo "cmdline-tools not found; installing…"
66+
mkdir -p "$SDKROOT/cmdline-tools"
67+
curl -sSL -o /tmp/clt.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
68+
sudo unzip -q /tmp/clt.zip -d "$SDKROOT/cmdline-tools"
69+
sudo mv "$SDKROOT/cmdline-tools/cmdline-tools" "$SDKROOT/cmdline-tools/latest"
70+
SDKMANAGER="$SDKROOT/cmdline-tools/latest/bin/sdkmanager"
71+
fi
72+
73+
echo "Installing platform-tools, Build-Tools 35, platform android-35, NDK r28, and CMake…"
74+
# Avoid 'yes' SIGPIPE killing the step: turn off pipefail just for these lines
75+
set +o pipefail
76+
yes | sudo "$SDKMANAGER" --install \
77+
"platform-tools" \
78+
"build-tools;35.0.0" \
79+
"platforms;android-35" \
80+
"ndk;28.0.12433566" \
81+
"cmake;3.22.1"
82+
83+
yes | "$SDKMANAGER" --licenses
84+
set -o pipefail
85+
86+
# Quick sanity prints (non-fatal)
87+
"$SDKROOT/ndk/28.0.12433566/ndk-build" -v >/dev/null 2>&1 || true
88+
"$SDKMANAGER" --list | sed -n '1,80p' || true
89+
90+
# Build and publish locally for the test app to find the SNAPSHOT version
91+
- name: Build ${{ env.PACKAGE_NAME }}
92+
run: |
93+
# Manually set -Xmx (max heap size) to something huge (tested 2g and that works, but why not go bigger).
94+
# Only in CI, gradle daemon runs out of memory during "lintAnalyzeDebug" task, unless you specify it this way.
95+
# You'd think Java's default of 25% RAM (ubuntu24 runner has 12g, so max 4g) would be sufficient, but no.
96+
# You'd think setting -Xmx via gradle.properties would help, but no.
97+
./gradlew :android:crt:build -Dorg.gradle.jvmargs="-Xmx8g"
98+
./gradlew -PnewVersion="1.0.0-SNAPSHOT" :android:crt:publishToMavenLocal
99+
# Setup files required by test app for Device Farm testing
100+
- name: Setup Android Test Files
101+
run: |
102+
cd src/test/android/testapp/src/main/assets
103+
python3 -m pip install boto3
104+
python3 ./android_file_creation.py
105+
106+
- name: Set Android keystore home
107+
run: |
108+
echo "ANDROID_SDK_HOME=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
109+
echo "ANDROID_PREFS_ROOT=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
110+
mkdir -p "$GITHUB_WORKSPACE/.android-home/.android"
111+
112+
- name: Create debug keystore
113+
run: |
114+
keytool -genkeypair \
115+
-keystore "$ANDROID_SDK_HOME/.android/debug.keystore" \
116+
-storepass android -keypass android \
117+
-alias androiddebugkey \
118+
-dname "CN=Android Debug,O=Android,C=US" \
119+
-keyalg RSA -keysize 2048 -validity 14000
120+
121+
- name: Build Test App
122+
run: |
123+
cd src/test/android/testapp
124+
../../../../gradlew assembledebug
125+
../../../../gradlew assembleAndroidTest
126+
- name: Device Farm Tests Highly Available
127+
run: |
128+
echo "Running Device Farm Python Script"
129+
python3 ./.github/workflows/run_android_ci.py \
130+
--run_id ${{ github.run_id }} \
131+
--run_attempt ${{ github.run_attempt }} \
132+
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
133+
--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'\') \
134+
--device_pool highly_available
135+
- name: Device Farm Tests Android 8.0.0
136+
run: |
137+
echo "Running Device Farm Python Script"
138+
python3 ./.github/workflows/run_android_ci.py \
139+
--run_id ${{ github.run_id }} \
140+
--run_attempt ${{ github.run_attempt }} \
141+
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
142+
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArnAndroid8" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
143+
--device_pool android_8

.github/workflows/ci-slow.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI Slow
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'main'
7+
- 'docs'
8+
9+
# cancel in-progress builds after a new commit
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
BUILDER_VERSION: v0.9.84
16+
BUILDER_SOURCE: releases
17+
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
18+
PACKAGE_NAME: aws-crt-java
19+
RUN: ${{ github.run_id }}-${{ github.run_number }}
20+
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
21+
AWS_DEFAULT_REGION: us-east-1
22+
AWS_REGION: us-east-1
23+
24+
permissions:
25+
id-token: write # This is required for requesting the JWT
26+
27+
jobs:
28+
linux-musl-arm:
29+
runs-on: ubuntu-24.04
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
image:
34+
- alpine-3.16-armv7
35+
- alpine-3.16-arm64
36+
steps:
37+
- uses: aws-actions/configure-aws-credentials@v4
38+
with:
39+
role-to-assume: ${{ env.CRT_CI_ROLE }}
40+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
41+
role-duration-seconds: 14400 # these tests run slow and easily reach default cred expiry, hence change expiry to 4hrs
42+
- name: Install qemu/docker
43+
run: docker run --privileged --rm tonistiigi/binfmt --install all
44+
- name: Build ${{ env.PACKAGE_NAME }}
45+
run: |
46+
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
47+
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
48+
49+
raspberry:
50+
runs-on: ubuntu-24.04 # latest
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
image:
55+
- raspbian-bullseye
56+
steps:
57+
- uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
role-to-assume: ${{ env.CRT_CI_ROLE }}
60+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
61+
- name: Install qemu/docker
62+
run: docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
63+
- name: Build ${{ env.PACKAGE_NAME }}
64+
run: |
65+
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
66+
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}

.github/workflows/ci.yml

Lines changed: 0 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -163,46 +163,6 @@ jobs:
163163
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
164164
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
165165
166-
linux-musl-arm:
167-
runs-on: ubuntu-24.04
168-
strategy:
169-
fail-fast: false
170-
matrix:
171-
image:
172-
- alpine-3.16-armv7
173-
- alpine-3.16-arm64
174-
steps:
175-
- uses: aws-actions/configure-aws-credentials@v4
176-
with:
177-
role-to-assume: ${{ env.CRT_CI_ROLE }}
178-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
179-
role-duration-seconds: 14400 # these tests run slow and easily reach default cred expiry, hence change expiry to 4hrs
180-
- name: Install qemu/docker
181-
run: docker run --privileged --rm tonistiigi/binfmt --install all
182-
- name: Build ${{ env.PACKAGE_NAME }}
183-
run: |
184-
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
185-
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
186-
187-
raspberry:
188-
runs-on: ubuntu-24.04 # latest
189-
strategy:
190-
fail-fast: false
191-
matrix:
192-
image:
193-
- raspbian-bullseye
194-
steps:
195-
- uses: aws-actions/configure-aws-credentials@v4
196-
with:
197-
role-to-assume: ${{ env.CRT_CI_ROLE }}
198-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
199-
- name: Install qemu/docker
200-
run: docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
201-
- name: Build ${{ env.PACKAGE_NAME }}
202-
run: |
203-
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
204-
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
205-
206166
windows:
207167
runs-on: windows-2025 # latest
208168
steps:
@@ -277,122 +237,6 @@ jobs:
277237
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
278238
python3 codebuild/macos_compatibility_check.py
279239
280-
android:
281-
# ubuntu-24.04 comes with Android tooling
282-
name: Android
283-
runs-on: ubuntu-24.04 # latest
284-
steps:
285-
- uses: aws-actions/configure-aws-credentials@v4
286-
with:
287-
role-to-assume: ${{ env.CRT_CI_ROLE }}
288-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
289-
- name: Checkout Sources
290-
uses: actions/checkout@v4
291-
with:
292-
submodules: true
293-
# Setup JDK 17
294-
- name: set up JDK 17
295-
uses: actions/setup-java@v4
296-
with:
297-
java-version: '17'
298-
distribution: 'temurin'
299-
# Ensure Gradle uses this JDK (important when toolchains are present)
300-
- name: Point Gradle at JDK 17
301-
run: echo "ORG_GRADLE_JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
302-
303-
- name: Mirror ANDROID_HOME → ANDROID_SDK_ROOT
304-
run: echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> "$GITHUB_ENV"
305-
306-
# Install required Android components & accept licenses (NDK r28 + compileSdk 35)
307-
- name: Install Android SDK packages
308-
shell: bash
309-
run: |
310-
set -euo pipefail
311-
SDKROOT="${ANDROID_SDK_ROOT:-$ANDROID_HOME}"
312-
SDKMANAGER="$SDKROOT/cmdline-tools/latest/bin/sdkmanager"
313-
314-
# Some images have cmdline-tools already; ensure path exists
315-
if [[ ! -x "$SDKMANAGER" ]]; then
316-
echo "cmdline-tools not found; installing…"
317-
mkdir -p "$SDKROOT/cmdline-tools"
318-
curl -sSL -o /tmp/clt.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
319-
sudo unzip -q /tmp/clt.zip -d "$SDKROOT/cmdline-tools"
320-
sudo mv "$SDKROOT/cmdline-tools/cmdline-tools" "$SDKROOT/cmdline-tools/latest"
321-
SDKMANAGER="$SDKROOT/cmdline-tools/latest/bin/sdkmanager"
322-
fi
323-
324-
echo "Installing platform-tools, Build-Tools 35, platform android-35, NDK r28, and CMake…"
325-
# Avoid 'yes' SIGPIPE killing the step: turn off pipefail just for these lines
326-
set +o pipefail
327-
yes | sudo "$SDKMANAGER" --install \
328-
"platform-tools" \
329-
"build-tools;35.0.0" \
330-
"platforms;android-35" \
331-
"ndk;28.0.12433566" \
332-
"cmake;3.22.1"
333-
334-
yes | "$SDKMANAGER" --licenses
335-
set -o pipefail
336-
337-
# Quick sanity prints (non-fatal)
338-
"$SDKROOT/ndk/28.0.12433566/ndk-build" -v >/dev/null 2>&1 || true
339-
"$SDKMANAGER" --list | sed -n '1,80p' || true
340-
341-
# Build and publish locally for the test app to find the SNAPSHOT version
342-
- name: Build ${{ env.PACKAGE_NAME }}
343-
run: |
344-
# Manually set -Xmx (max heap size) to something huge (tested 2g and that works, but why not go bigger).
345-
# Only in CI, gradle daemon runs out of memory during "lintAnalyzeDebug" task, unless you specify it this way.
346-
# You'd think Java's default of 25% RAM (ubuntu24 runner has 12g, so max 4g) would be sufficient, but no.
347-
# You'd think setting -Xmx via gradle.properties would help, but no.
348-
./gradlew :android:crt:build -Dorg.gradle.jvmargs="-Xmx8g"
349-
./gradlew -PnewVersion="1.0.0-SNAPSHOT" :android:crt:publishToMavenLocal
350-
# Setup files required by test app for Device Farm testing
351-
- name: Setup Android Test Files
352-
run: |
353-
cd src/test/android/testapp/src/main/assets
354-
python3 -m pip install boto3
355-
python3 ./android_file_creation.py
356-
357-
- name: Set Android keystore home
358-
run: |
359-
echo "ANDROID_SDK_HOME=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
360-
echo "ANDROID_PREFS_ROOT=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
361-
mkdir -p "$GITHUB_WORKSPACE/.android-home/.android"
362-
363-
- name: Create debug keystore
364-
run: |
365-
keytool -genkeypair \
366-
-keystore "$ANDROID_SDK_HOME/.android/debug.keystore" \
367-
-storepass android -keypass android \
368-
-alias androiddebugkey \
369-
-dname "CN=Android Debug,O=Android,C=US" \
370-
-keyalg RSA -keysize 2048 -validity 14000
371-
372-
- name: Build Test App
373-
run: |
374-
cd src/test/android/testapp
375-
../../../../gradlew assembledebug
376-
../../../../gradlew assembleAndroidTest
377-
- name: Device Farm Tests Highly Available
378-
run: |
379-
echo "Running Device Farm Python Script"
380-
python3 ./.github/workflows/run_android_ci.py \
381-
--run_id ${{ github.run_id }} \
382-
--run_attempt ${{ github.run_attempt }} \
383-
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
384-
--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'\') \
385-
--device_pool highly_available
386-
- name: Device Farm Tests Android 8.0.0
387-
run: |
388-
echo "Running Device Farm Python Script"
389-
python3 ./.github/workflows/run_android_ci.py \
390-
--run_id ${{ github.run_id }} \
391-
--run_attempt ${{ github.run_attempt }} \
392-
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
393-
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArnAndroid8" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
394-
--device_pool android_8
395-
396240
# check that docs can still build
397241
check-docs:
398242
runs-on: ubuntu-22.04 # use same version as docs.yml

0 commit comments

Comments
 (0)