|
29 | 29 | CI_JOBS_ROLE: arn:aws:iam::180635532705:role/CI_Jobs_Role
|
30 | 30 | CI_FLEET_PROVISIONING_ROLE: arn:aws:iam::180635532705:role/service-role/CI_FleetProvisioning_Role
|
31 | 31 | CI_GREENGRASS_ROLE: arn:aws:iam::180635532705:role/CI_Greengrass_Role
|
| 32 | + CI_GREENGRASS_INSTALLER_ROLE: arn:aws:iam::180635532705:role/CI_GreengrassInstaller_Role |
32 | 33 | CI_DEVICE_ADVISOR: arn:aws:iam::180635532705:role/CI_DeviceAdvisor_Role
|
33 | 34 | CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role
|
34 | 35 | CI_BUILD_AND_TEST_ROLE: arn:aws:iam::180635532705:role/V2_SDK_Unit_Testing
|
@@ -393,14 +394,66 @@ jobs:
|
393 | 394 | Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())")
|
394 | 395 | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_fleet_provisioning_cfg.json --input_uuid ${Sample_UUID}
|
395 | 396 | python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1"
|
396 |
| - - name: configure AWS credentials (Greengrass) |
| 397 | +
|
| 398 | + linux-greengrass-tests: |
| 399 | + runs-on: ubuntu-22.04 |
| 400 | + permissions: |
| 401 | + id-token: write # This is required for requesting the JWT |
| 402 | + steps: |
| 403 | + - name: Setup environment |
| 404 | + run: | |
| 405 | + python3 -m pip install boto3 |
| 406 | + - name: configure AWS credentials (containers) |
397 | 407 | uses: aws-actions/configure-aws-credentials@v2
|
398 | 408 | with:
|
399 |
| - role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} |
| 409 | + role-to-assume: ${{ env.CI_BUILD_AND_TEST_ROLE }} |
400 | 410 | aws-region: ${{ env.AWS_DEFAULT_REGION }}
|
401 |
| - - name: run Greengrass Discovery sample |
| 411 | + - name: Build ${{ env.PACKAGE_NAME }} |
| 412 | + run: | |
| 413 | + python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" |
| 414 | + chmod a+x builder |
| 415 | + ./builder build -p ${{ env.PACKAGE_NAME }} |
| 416 | + - name: Install Greengrass Development Kit |
402 | 417 | run: |
|
403 |
| - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_greengrass_discovery_cfg.json |
| 418 | + python3 -m pip install awsiotsdk |
| 419 | + python3 -m pip install -U git+https://github.com/aws-greengrass/[email protected] |
| 420 | + - name: Configure AWS credentials (Greengrass) |
| 421 | + uses: aws-actions/configure-aws-credentials@v2 |
| 422 | + with: |
| 423 | + role-to-assume: ${{ env.CI_GREENGRASS_INSTALLER_ROLE }} |
| 424 | + aws-region: ${{ env.AWS_DEFAULT_REGION }} |
| 425 | + - name: Build and run Greengrass basic discovery sample |
| 426 | + working-directory: ./aws-iot-device-sdk-python-v2/test/greengrass/basic_discovery |
| 427 | + run: | |
| 428 | + export PYTHONPATH=${{ github.workspace }}/aws-iot-device-sdk-python-v2/samples |
| 429 | + gdk component build |
| 430 | + gdk test-e2e build |
| 431 | + gdk test-e2e run |
| 432 | + - name: Show logs |
| 433 | + working-directory: ./aws-iot-device-sdk-python-v2/test/greengrass/basic_discovery |
| 434 | + # Print logs unconditionally to provide more details on Greengrass run even if the test failed. |
| 435 | + if: always() |
| 436 | + run: | |
| 437 | + echo "=== greengrass.log" |
| 438 | + cat testResults/gg*/greengrass.log |
| 439 | + echo "=== software.amazon.awssdk.sdk-gg-test-discovery.log" |
| 440 | + cat testResults/gg*/software.amazon.awssdk.sdk-gg-test-discovery.log |
| 441 | + - name: Build and run Greengrass IPC sample |
| 442 | + working-directory: ./aws-iot-device-sdk-python-v2/test/greengrass/ipc |
| 443 | + run: | |
| 444 | + gdk component build |
| 445 | + gdk test-e2e build |
| 446 | + gdk test-e2e run |
| 447 | + - name: Show logs |
| 448 | + working-directory: ./aws-iot-device-sdk-python-v2/test/greengrass/ipc |
| 449 | + # Print logs unconditionally to provide more details on Greengrass run even if the test failed. |
| 450 | + if: always() |
| 451 | + run: | |
| 452 | + echo "=== greengrass.log" |
| 453 | + cat testResults/gg*/greengrass.log |
| 454 | + echo "=== software.amazon.awssdk.sdk-gg-ipc.log" |
| 455 | + cat testResults/gg*/software.amazon.awssdk.sdk-gg-ipc.log |
| 456 | +
|
404 | 457 |
|
405 | 458 | # check that docs can still build
|
406 | 459 | check-docs:
|
|
0 commit comments