Run Integration Tests for Release Candidate #7
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 for Release Candidate | |
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_id: | |
description: 'The build ID (release candidate build number or GitHub commit SHA)' | |
type: string | |
required: true | |
test_repo_branch: | |
description: 'Override for the test repo branch (default is main)' | |
type: string | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
OutputEnvVariables: | |
name: 'OutputEnvVariables' | |
runs-on: ubuntu-latest | |
outputs: | |
CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} | |
CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} | |
CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} | |
steps: | |
- name: SetOutputs | |
id: set-outputs | |
run: | | |
CWA_GITHUB_TEST_REPO_BRANCH=${{ inputs.test_repo_branch }} | |
echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" >> "$GITHUB_OUTPUT" | |
echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" >> "$GITHUB_OUTPUT" | |
echo "CWA_GITHUB_TEST_REPO_BRANCH=${CWA_GITHUB_TEST_REPO_BRANCH:-${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}}" >> "$GITHUB_OUTPUT" | |
- name: Echo test variables | |
run: | | |
echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" | |
echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" | |
echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} | |
ref: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ~1.22.2 | |
RepackageReleaseCandidate: | |
name: 'RepackageReleaseCandidate' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}} | |
ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH}} | |
path: test | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ env.TERRAFORM_AWS_ASSUME_ROLE }} | |
aws-region: us-west-2 | |
role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }} | |
- name: Download Artifacts | |
id: download-artifacts | |
run: | | |
aws s3 cp --no-progress s3://amazon-cloud-watch-agent/windows/amd64/${{ inputs.build_id }} . | |
aws s3 cp --no-progress s3://amazon-cloud-watch-agent/linux/amd64/${{ inputs.build_id }} . | |
aws s3 cp --no-progress s3://amazon-cloud-watch-agent/darwin/amd64/${{ inputs.build_id }} . |