|
37 | 37 | CI_X509_ROLE: arn:aws:iam::180635532705:role/CI_X509_Role
|
38 | 38 | CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role
|
39 | 39 | CI_GREENGRASS_ROLE: arn:aws:iam::180635532705:role/CI_Greengrass_Role
|
| 40 | + CI_GREENGRASS_INSTALLER_ROLE: arn:aws:iam::180635532705:role/CI_GreengrassInstaller_Role |
40 | 41 | CI_JOBS_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_JobsServiceClient_Role
|
41 | 42 | CI_SHADOW_SERVICE_CLIENT_ROLE: arn:aws:iam::180635532705:role/CI_ShadowServiceClient_Role
|
42 | 43 |
|
@@ -641,14 +642,66 @@ jobs:
|
641 | 642 | - name: run X509 sample
|
642 | 643 | run: |
|
643 | 644 | python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_x509_connect_cfg.json
|
644 |
| - - name: configure AWS credentials (Greengrass) |
645 |
| - uses: aws-actions/configure-aws-credentials@v2 |
646 |
| - with: |
647 |
| - role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} |
648 |
| - aws-region: ${{ env.AWS_DEFAULT_REGION }} |
649 |
| - - name: run Greengrass Discovery sample |
| 645 | +
|
| 646 | + # Runs the Greengrass samples |
| 647 | + linux-greengrass-tests: |
| 648 | + runs-on: ubuntu-latest |
| 649 | + permissions: |
| 650 | + id-token: write # This is required for requesting the JWT |
| 651 | + steps: |
| 652 | + - name: Setup C++ |
| 653 | + run: | |
| 654 | + sudo apt-get -qq update -y |
| 655 | + sudo apt-get -qq install -y build-essential |
| 656 | + sudo apt install cmake |
| 657 | + gcc --version |
| 658 | + cmake --version |
| 659 | + - name: Build ${{ env.PACKAGE_NAME }} + consumers |
650 | 660 | run: |
|
651 |
| - python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_greengrass_discovery_cfg.json |
| 661 | + echo "Downloading source" |
| 662 | + git clone --recursive https://github.com/aws/aws-iot-device-sdk-cpp-v2.git --branch ${{ env.HEAD_REF || github.ref_name }} |
| 663 | + echo "Running builder" |
| 664 | + python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" |
| 665 | + python builder.pyz build -p ${{ env.PACKAGE_NAME }} --variant build_gg_samples_only |
| 666 | + - name: Install Greengrass Development Kit |
| 667 | + run: | |
| 668 | + python3 -m pip install awsiotsdk |
| 669 | + python3 -m pip install -U git+https://github.com/aws-greengrass/[email protected] |
| 670 | + - name: Configure AWS credentials (Greengrass) |
| 671 | + uses: aws-actions/configure-aws-credentials@v2 |
| 672 | + with: |
| 673 | + role-to-assume: ${{ env.CI_GREENGRASS_INSTALLER_ROLE }} |
| 674 | + aws-region: ${{ env.AWS_DEFAULT_REGION }} |
| 675 | + - name: Build and run Greengrass basic discovery sample |
| 676 | + working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/basic_discovery |
| 677 | + run: | |
| 678 | + gdk component build |
| 679 | + gdk test-e2e build |
| 680 | + gdk test-e2e run |
| 681 | + - name: Show logs |
| 682 | + working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/basic_discovery |
| 683 | + # Print logs unconditionally to provide more details on Greengrass run even if the test failed. |
| 684 | + if: always() |
| 685 | + run: | |
| 686 | + echo "=== greengrass.log" |
| 687 | + cat testResults/gg*/greengrass.log |
| 688 | + echo "=== software.amazon.awssdk.sdk-gg-test-discovery.log" |
| 689 | + cat testResults/gg*/software.amazon.awssdk.sdk-gg-test-discovery.log |
| 690 | + - name: Build and run Greengrass IPC sample |
| 691 | + working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/ipc |
| 692 | + run: | |
| 693 | + gdk component build |
| 694 | + gdk test-e2e build |
| 695 | + gdk test-e2e run |
| 696 | + - name: Show logs |
| 697 | + working-directory: ./aws-iot-device-sdk-cpp-v2/tests/greengrass/ipc |
| 698 | + # Print logs unconditionally to provide more details on Greengrass run even if the test failed. |
| 699 | + if: always() |
| 700 | + run: | |
| 701 | + echo "=== greengrass.log" |
| 702 | + cat testResults/gg*/greengrass.log |
| 703 | + echo "=== software.amazon.awssdk.sdk-gg-ipc.log" |
| 704 | + cat testResults/gg*/software.amazon.awssdk.sdk-gg-ipc.log |
652 | 705 |
|
653 | 706 | # check that docs can still build
|
654 | 707 | check-docs:
|
|
0 commit comments