Run Integration Tests #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# SPDX-License-Identifier: MIT | |
name: Run Integration Tests | |
env: | |
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE_KEY }} | |
TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} | |
TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours | |
S3_INTEGRATION_BUCKET: ${{ vars.S3_INTEGRATION_BUCKET }} | |
KEY_NAME: ${{ secrets.KEY_NAME }} | |
CF_IAM_ROLE: ${{ secrets.CF_IAM_ROLE }} | |
CF_KEY_NAME: ${{ secrets.CF_KEY_NAME }} | |
ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" | |
CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" | |
CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" | |
CWA_GITHUB_TEST_REPO_BRANCH: "main" | |
TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} | |
S3_INTEGRATION_BUCKET_ITAR: ${{ vars.S3_INTEGRATION_BUCKET_ITAR }} | |
TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} | |
S3_INTEGRATION_BUCKET_CN: ${{ vars.S3_INTEGRATION_BUCKET_CN }} | |
on: | |
workflow_dispatch: | |
inputs: | |
build_run_id: | |
description: 'The ID of the build-test-artifacts workflow run' | |
type: number | |
required: true | |
build_sha: | |
description: 'The SHA of the build' | |
type: string | |
required: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
CheckBuildTestArtifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
conclusion=$(gh run view ${{ inputs.build_run_id }} --repo $GITHUB_REPOSITORY --json conclusion -q '.conclusion') | |
if [[ $conclusion == "success" ]]; then | |
echo "Run succeeded" | |
else | |
echo "Run failed" | |
exit 1 | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
if [[ ${{ inputs.build_sha }} == ${{ github.sha }} ]]; then | |
echo "SHA is the same" | |
else | |
echo "Build workflow SHA and test SHA are different" | |
exit 1 | |
fi | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo ${{ github.workflow }}-${{ github.ref_name }} | |
Test2: | |
needs: CheckBuildTestArtifacts | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo ${{ toJSON(github) }} |