diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b14cc2c..19f6adcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ env: CI_SHADOW_ROLE: arn:aws:iam::180635532705:role/CI_Shadow_Role CI_JOBS_ROLE: arn:aws:iam::180635532705:role/CI_Jobs_Role CI_FLEET_PROVISIONING_ROLE: arn:aws:iam::180635532705:role/service-role/CI_FleetProvisioning_Role + CI_GREENGRASS_ROLE: arn:aws:iam::180635532705:role/CI_Greengrass_Role CI_DEVICE_ADVISOR: arn:aws:iam::180635532705:role/CI_DeviceAdvisor_Role CI_MQTT5_ROLE: arn:aws:iam::180635532705:role/CI_MQTT5_Role CI_BUILD_AND_TEST_ROLE: arn:aws:iam::180635532705:role/V2_SDK_Unit_Testing @@ -297,6 +298,14 @@ jobs: Sample_UUID=$(python3 -c "import uuid; print (uuid.uuid4())") python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_fleet_provisioning_cfg.json --input_uuid ${Sample_UUID} python3 ${{ env.CI_UTILS_FOLDER }}/delete_iot_thing_ci.py --thing_name "Fleet_Thing_${Sample_UUID}" --region "us-east-1" + - name: configure AWS credentials (Greengrass) + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ env.CI_GREENGRASS_ROLE }} + aws-region: ${{ env.AWS_DEFAULT_REGION }} + - name: run Greengrass Discovery sample + run: | + python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_greengrass_discovery_cfg.json # check that docs can still build check-docs: diff --git a/.github/workflows/ci_run_greengrass_discovery_cfg.json b/.github/workflows/ci_run_greengrass_discovery_cfg.json new file mode 100644 index 00000000..5e67b26c --- /dev/null +++ b/.github/workflows/ci_run_greengrass_discovery_cfg.json @@ -0,0 +1,39 @@ +{ + "language": "Python", + "sample_file": "./aws-iot-device-sdk-python-v2/samples/basic_discovery.py", + "sample_region": "us-east-1", + "sample_main_class": "", + "arguments": [ + { + "name": "--cert", + "secret": "ci/Greengrass/cert", + "filename": "tmp_certificate.pem" + }, + { + "name": "--key", + "secret": "ci/Greengrass/key", + "filename": "tmp_key.pem" + }, + { + "name": "--ca_file", + "secret": "ci/Greengrass/ca", + "filename": "tmp_ca.pem" + }, + { + "name": "--region", + "data": "us-east-1" + }, + { + "name": "--thing_name", + "data": "CI_GreenGrass_Thing" + }, + { + "name": "--is_ci", + "data": "true" + }, + { + "name": "--print_discover_resp_only", + "data": "" + } + ] +} diff --git a/samples/basic_discovery.py b/samples/basic_discovery.py index 02b5eeec..63a69d72 100644 --- a/samples/basic_discovery.py +++ b/samples/basic_discovery.py @@ -37,7 +37,11 @@ resp_future = discovery_client.discover(cmdData.input_thing_name) discover_response = resp_future.result() -print(discover_response) +if (cmdData.input_is_ci): + print("Received a greengrass discovery result! Not showing result in CI for possible data sensitivity.") +else: + print(discover_response) + if (cmdData.input_print_discovery_resp_only): exit(0) diff --git a/utils/run_sample_ci.py b/utils/run_sample_ci.py index fb6dc6ef..512d6fe2 100644 --- a/utils/run_sample_ci.py +++ b/utils/run_sample_ci.py @@ -83,7 +83,8 @@ def setup_json_arguments_list(parsed_commands): if isinstance(tmp_value, str) and 'input_uuid' in parsed_commands: if ("$INPUT_UUID" in tmp_value): tmp_value = tmp_value.replace("$INPUT_UUID", parsed_commands.input_uuid) - config_json_arguments_list.append(tmp_value) + if (tmp_value != None and tmp_value != ""): + config_json_arguments_list.append(tmp_value) # None of the above? Just print an error else: