Skip to content

Commit adfa89a

Browse files
authored
Merge branch 'main' into restructure-readme
2 parents f2a4eee + 335df21 commit adfa89a

File tree

145 files changed

+2908
-8871
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2908
-8871
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'docs'
88

99
env:
10-
BUILDER_VERSION: v0.9.75
10+
BUILDER_VERSION: v0.9.84
1111
BUILDER_SOURCE: releases
1212
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1313
PACKAGE_NAME: aws-iot-device-sdk-java-v2
@@ -19,15 +19,7 @@ env:
1919
DA_SHADOW_PROPERTY: datest
2020
DA_SHADOW_VALUE_SET: ON
2121
DA_SHADOW_VALUE_DEFAULT: OFF
22-
CI_IOT_CONTAINERS: arn:aws:iam::123124136734:role/CRT_IoT_Containers
23-
CI_PUBSUB_ROLE: arn:aws:iam::180635532705:role/CI_PubSub_Role
24-
CI_COGNITO_ROLE: arn:aws:iam::180635532705:role/CI_Cognito_Role
25-
CI_CUSTOM_AUTHORIZER_ROLE: arn:aws:iam::180635532705:role/CI_CustomAuthorizer_Role
26-
CI_SHADOW_ROLE: arn:aws:iam::180635532705:role/CI_Shadow_Role
27-
CI_JOBS_ROLE: arn:aws:iam::180635532705:role/CI_Jobs_Role
2822
CI_FLEET_PROVISIONING_ROLE: arn:aws:iam::180635532705:role/service-role/CI_FleetProvisioning_Role
29-
CI_DEVICE_ADVISOR: arn:aws:iam::180635532705:role/CI_DeviceAdvisor_Role
30-
CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role
3123
CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role
3224
CI_ANDROID_DEVICE_TESTING_ROLE: arn:aws:iam::180635532705:role/CI_Android_Device_Testing_Role
3325
CI_SHADOW_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_ShadowServiceClient_Role
@@ -83,37 +75,6 @@ jobs:
8375
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
8476
mvn test -Dtest=Mqtt5BuilderTest -Dsurefire.failIfNoSpecifiedTests=false
8577
source utils/test_cleanup.sh
86-
- name: Running samples in CI setup
87-
run: |
88-
python -m pip install boto3
89-
mvn install -DskipTests
90-
- name: configure AWS credentials (PubSub)
91-
uses: aws-actions/configure-aws-credentials@v2
92-
with:
93-
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
94-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
95-
- name: run PubSub sample
96-
run: |
97-
python ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pubsub_cfg.json
98-
- name: run Windows Certificate Connect sample
99-
run: |
100-
python ./utils/run_in_ci.py --file ./.github/workflows/ci_run_windows_cert_connect_cfg.json
101-
- name: configure AWS credentials (MQTT5)
102-
uses: aws-actions/configure-aws-credentials@v2
103-
with:
104-
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
105-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
106-
- name: run MQTT5 PubSub sample
107-
run: |
108-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_pubsub_cfg.json
109-
- name: configure AWS credentials (Device Advisor)
110-
uses: aws-actions/configure-aws-credentials@v2
111-
with:
112-
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
113-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
114-
- name: run DeviceAdvisor
115-
run: |
116-
python ./deviceadvisor/script/DATestRun.py
11778
11879
osx-java-compat:
11980
runs-on: macos-latest
@@ -162,47 +123,6 @@ jobs:
162123
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
163124
mvn test -Dtest=Mqtt5BuilderTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false
164125
source utils/test_cleanup.sh
165-
- name: Running samples in CI setup
166-
run: |
167-
python3 -m venv .venv
168-
source .venv/bin/activate
169-
python3 -m pip install boto3
170-
mvn install -Dmaven.test.skip=true
171-
- name: configure AWS credentials (PubSub)
172-
uses: aws-actions/configure-aws-credentials@v2
173-
with:
174-
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
175-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
176-
- name: run PubSub sample
177-
run: |
178-
source .venv/bin/activate
179-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pubsub_cfg.json
180-
- name: run PKCS12 Connect sample
181-
run: |
182-
cert=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/cert" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem
183-
key=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem
184-
pkcs12_password=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key_pkcs12_password" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\")
185-
openssl pkcs12 -export -in /tmp/certificate.pem -inkey /tmp/privatekey.pem -out ./pkcs12-key.p12 -name PubSub_Thing_Alias -password pass:$pkcs12_password
186-
source .venv/bin/activate
187-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pkcs12_connect_cfg.json
188-
- name: configure AWS credentials (MQTT5)
189-
uses: aws-actions/configure-aws-credentials@v2
190-
with:
191-
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
192-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
193-
- name: run MQTT5 PubSub sample
194-
run: |
195-
source .venv/bin/activate
196-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_pubsub_cfg.json
197-
- name: configure AWS credentials (Device Advisor)
198-
uses: aws-actions/configure-aws-credentials@v2
199-
with:
200-
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
201-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
202-
- name: run DeviceAdvisor
203-
run: |
204-
source .venv/bin/activate
205-
python3 ./deviceadvisor/script/DATestRun.py
206126
207127
linux-java-compat:
208128
runs-on: ubuntu-latest
@@ -251,33 +171,6 @@ jobs:
251171
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
252172
mvn test -Dtest=Mqtt5BuilderTest -Dsurefire.failIfNoSpecifiedTests=false
253173
source utils/test_cleanup.sh
254-
- name: Running samples in CI setup
255-
run: |
256-
python3 -m pip install boto3
257-
- name: configure AWS credentials (PubSub)
258-
uses: aws-actions/configure-aws-credentials@v2
259-
with:
260-
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
261-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
262-
- name: run PubSub sample
263-
run: |
264-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pubsub_cfg.json
265-
- name: configure AWS credentials (MQTT5)
266-
uses: aws-actions/configure-aws-credentials@v2
267-
with:
268-
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
269-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
270-
- name: run MQTT5 PubSub sample
271-
run: |
272-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_pubsub_cfg.json
273-
- name: configure AWS credentials (Device Advisor)
274-
uses: aws-actions/configure-aws-credentials@v2
275-
with:
276-
role-to-assume: ${{ env.CI_DEVICE_ADVISOR }}
277-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
278-
- name: run DeviceAdvisor
279-
run: |
280-
python3 ./deviceadvisor/script/DATestRun.py
281174
282175
android-device-farm:
283176
name: Android Device Farm
@@ -290,13 +183,18 @@ jobs:
290183
uses: actions/checkout@v2
291184
with:
292185
submodules: true
293-
# Setup JDK 11
294-
- name: set up JDK 11
295-
uses: actions/setup-java@v3.14.1
186+
# Setup JDK 17
187+
- name: set up JDK 17
188+
uses: actions/setup-java@v4
296189
with:
297-
java-version: '11'
190+
java-version: '17'
298191
distribution: 'temurin'
299192
cache: 'gradle'
193+
# Ensure Gradle uses this JDK (important when toolchains are present)
194+
- name: Point Gradle at JDK 17
195+
run: echo "ORG_GRADLE_JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
196+
- name: Mirror ANDROID_HOME → ANDROID_SDK_ROOT
197+
run: echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> "$GITHUB_ENV"
300198
- name: Configure AWS credentials for Device Farm
301199
uses: aws-actions/configure-aws-credentials@v2
302200
with:
@@ -314,6 +212,21 @@ jobs:
314212
cd sdk/tests/android/testapp/src/main/assets
315213
python3 -m pip install boto3
316214
python3 ./android_file_creation.py
215+
216+
- name: Set Android keystore home
217+
run: |
218+
echo "ANDROID_SDK_HOME=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
219+
echo "ANDROID_PREFS_ROOT=$GITHUB_WORKSPACE/.android-home" >> "$GITHUB_ENV"
220+
mkdir -p "$GITHUB_WORKSPACE/.android-home/.android"
221+
- name: Create debug keystore
222+
run: |
223+
keytool -genkeypair \
224+
-keystore "$ANDROID_SDK_HOME/.android/debug.keystore" \
225+
-storepass android -keypass android \
226+
-alias androiddebugkey \
227+
-dname "CN=Android Debug,O=Android,C=US" \
228+
-keyalg RSA -keysize 2048 -validity 14000
229+
317230
- name: Build Test App
318231
run: |
319232
cd sdk/tests/android/testapp
@@ -466,102 +379,3 @@ jobs:
466379
run: |
467380
export PYTHONPATH=${{ github.workspace }}/utils
468381
python3 ./test_cases/test_jobs_execution.py --mqtt-version 5
469-
- name: configure AWS credentials (Connect and PubSub)
470-
uses: aws-actions/configure-aws-credentials@v2
471-
with:
472-
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
473-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
474-
- name: run Basic Connect sample
475-
run: |
476-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_basic_connect_cfg.json
477-
- name: run Websocket Connect sample
478-
run: |
479-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_websocket_connect_cfg.json
480-
- name: run PubSub sample
481-
run: |
482-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pubsub_cfg.json
483-
- name: run CustomKeyOperations sample
484-
run: |
485-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_custom_key_ops_cfg.json
486-
- name: run PKCS11 Connect sample
487-
run: |
488-
mkdir -p /tmp/tokens
489-
export SOFTHSM2_CONF=/tmp/softhsm2.conf
490-
echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
491-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_pkcs11_connect_cfg.json
492-
- name: run Java keystore Connect sample
493-
run: |
494-
cert=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/cert" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem
495-
key=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem
496-
pkcs12_password=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key_pkcs12_password" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\")
497-
openssl pkcs12 -export -in /tmp/certificate.pem -inkey /tmp/privatekey.pem -out /tmp/pkcs12-key.p12 -name PubSub_Thing_Alias -password pass:$pkcs12_password
498-
keytool -importkeystore -srckeystore /tmp/pkcs12-key.p12 -destkeystore ./java_keystore.keys -srcstoretype PKCS12 -alias PubSub_Thing_Alias -srcstorepass $pkcs12_password -deststorepass $pkcs12_password
499-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_keystore_connect_cfg.json
500-
- name: configure AWS credentials (Cognito)
501-
uses: aws-actions/configure-aws-credentials@v2
502-
with:
503-
role-to-assume: ${{ env.CI_COGNITO_ROLE }}
504-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
505-
- name: run CognitoConnect sample
506-
run: |
507-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_cognito_connect_cfg.json
508-
- name: configure AWS credentials (Custom Authorizer)
509-
uses: aws-actions/configure-aws-credentials@v2
510-
with:
511-
role-to-assume: ${{ env.CI_CUSTOM_AUTHORIZER_ROLE }}
512-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
513-
- name: run CustomAuthorizerConnect sample
514-
run: |
515-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_custom_authorizer_connect_cfg.json
516-
- name: configure AWS credentials (Shadow)
517-
uses: aws-actions/configure-aws-credentials@v2
518-
with:
519-
role-to-assume: ${{ env.CI_SHADOW_ROLE }}
520-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
521-
- name: run Shadow sample
522-
run: |
523-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_shadow_cfg.json
524-
- name: run Mqtt5 Shadow sample
525-
run: |
526-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_shadow_mqtt5_cfg.json
527-
- name: configure AWS credentials (Jobs)
528-
uses: aws-actions/configure-aws-credentials@v2
529-
with:
530-
role-to-assume: ${{ env.CI_JOBS_ROLE }}
531-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
532-
- name: run Jobs sample
533-
run: |
534-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_jobs_cfg.json
535-
- name: run Mqtt5 Jobs sample
536-
run: |
537-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_jobs_mqtt5_cfg.json
538-
- name: configure AWS credentials (Fleet provisioning)
539-
uses: aws-actions/configure-aws-credentials@v2
540-
with:
541-
role-to-assume: ${{ env.CI_FLEET_PROVISIONING_ROLE }}
542-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
543-
- name: run Fleet Provisioning sample
544-
run: |
545-
python3 ./utils/run_fleet_provisioning_sample.py --file ./.github/workflows/ci_run_fleet_provisioning_cfg.json --thing-name-prefix "Fleet_Thing_"
546-
- name: run Mqtt5 Fleet Provisioning sample
547-
run: |
548-
python3 ./utils/run_fleet_provisioning_sample.py --file ./.github/workflows/ci_run_fleet_provisioning_mqtt5_cfg.json --thing-name-prefix "Fleet_Thing_"
549-
- name: configure AWS credentials (X509)
550-
uses: aws-actions/configure-aws-credentials@v2
551-
with:
552-
role-to-assume: ${{ env.CI_X509_ROLE }}
553-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
554-
- name: run X509 sample
555-
run: |
556-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_x509_connect_cfg.json
557-
- name: configure AWS credentials (MQTT5)
558-
uses: aws-actions/configure-aws-credentials@v2
559-
with:
560-
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
561-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
562-
- name: run MQTT5 PubSub sample
563-
run: |
564-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_pubsub_cfg.json
565-
- name: run MQTT5 Shared Subscription sample
566-
run: |
567-
python3 ./utils/run_in_ci.py --file ./.github/workflows/ci_run_mqtt5_shared_subscription_cfg.json

.github/workflows/ci_run_basic_connect_cfg.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/ci_run_cognito_connect_cfg.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci_run_custom_authorizer_connect_cfg.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci_run_custom_key_ops_cfg.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)