|
1 | | -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
2 | | -# SPDX-License-Identifier: MIT |
3 | | - |
4 | | -name: Run ROSA E2E Tests |
5 | | -env: |
6 | | - TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} |
7 | | - TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours |
8 | | - ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" |
9 | | - CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" |
10 | | - CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" |
11 | | - CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" |
12 | | - TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} |
13 | | - TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} |
14 | | - OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" |
15 | | - |
16 | | -on: |
17 | | -# schedule: |
18 | | -# - cron: '0 17 * * 1' |
19 | | - push: |
20 | | - branches: |
21 | | - - rosa |
22 | | - |
23 | | - workflow_dispatch: |
24 | | - inputs: |
25 | | - region: |
26 | | - required: false |
27 | | - type: string |
28 | | - description: 'AWS Region to run tests in' |
29 | | - default: 'us-west-2' |
30 | | - operator-branch: |
31 | | - required: false |
32 | | - type: string |
33 | | - description: 'Branch of the operator to test' |
34 | | - default: 'main' |
35 | | - helm-charts-branch: |
36 | | - required: false |
37 | | - type: string |
38 | | - description: 'Branch of the helm charts to test' |
39 | | - default: 'main' |
40 | | - |
41 | | -concurrency: |
42 | | - group: ${{ github.workflow }}-${{ github.ref_name }}-parent |
43 | | - cancel-in-progress: true |
44 | | - |
45 | | -jobs: |
46 | | -# GetLatestOperatorCommitSHA: |
| 1 | +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +## SPDX-License-Identifier: MIT |
| 3 | +# |
| 4 | +#name: Run ROSA E2E Tests |
| 5 | +#env: |
| 6 | +# TERRAFORM_AWS_ASSUME_ROLE: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} |
| 7 | +# TERRAFORM_AWS_ASSUME_ROLE_DURATION: 14400 # 4 hours |
| 8 | +# ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test" |
| 9 | +# CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test" |
| 10 | +# CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git" |
| 11 | +# CWA_GITHUB_TEST_REPO_BRANCH: "e2e-rosa" |
| 12 | +# TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }} |
| 13 | +# TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} |
| 14 | +# OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" |
| 15 | +# |
| 16 | +#on: |
| 17 | +## schedule: |
| 18 | +## - cron: '0 17 * * 1' |
| 19 | +# push: |
| 20 | +# branches: |
| 21 | +# - rosa |
| 22 | +# |
| 23 | +# workflow_dispatch: |
| 24 | +# inputs: |
| 25 | +# region: |
| 26 | +# required: false |
| 27 | +# type: string |
| 28 | +# description: 'AWS Region to run tests in' |
| 29 | +# default: 'us-west-2' |
| 30 | +# operator-branch: |
| 31 | +# required: false |
| 32 | +# type: string |
| 33 | +# description: 'Branch of the operator to test' |
| 34 | +# default: 'main' |
| 35 | +# helm-charts-branch: |
| 36 | +# required: false |
| 37 | +# type: string |
| 38 | +# description: 'Branch of the helm charts to test' |
| 39 | +# default: 'main' |
| 40 | +# |
| 41 | +#concurrency: |
| 42 | +# group: ${{ github.workflow }}-${{ github.ref_name }}-parent |
| 43 | +# cancel-in-progress: true |
| 44 | +# |
| 45 | +#jobs: |
| 46 | +## GetLatestOperatorCommitSHA: |
| 47 | +## runs-on: ubuntu-latest |
| 48 | +## outputs: |
| 49 | +## operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} |
| 50 | +## operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} |
| 51 | +## steps: |
| 52 | +## - name: Checkout the target repo |
| 53 | +## uses: actions/checkout@v3 |
| 54 | +## with: |
| 55 | +## repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} |
| 56 | +## ref: ${{ inputs.operator-branch || 'main' }} |
| 57 | +## path: operator-repo |
| 58 | +## |
| 59 | +## - name: Get latest commit SHA |
| 60 | +## id: get_latest_sha |
| 61 | +## run: | |
| 62 | +## cd operator-repo |
| 63 | +## latest_sha=$(git rev-parse HEAD) |
| 64 | +## echo "::set-output name=operator_sha::$latest_sha" |
| 65 | +# |
| 66 | +## BuildAgent: |
| 67 | +## uses: ./.github/workflows/build-test-artifacts.yml |
| 68 | +## concurrency: |
| 69 | +## group: "Build-Test-Artifacts-${{github.ref_name}}" |
| 70 | +## cancel-in-progress: true |
| 71 | +## secrets: inherit |
| 72 | +## permissions: |
| 73 | +## id-token: write |
| 74 | +## contents: read |
| 75 | +## with: |
| 76 | +## test-image-before-upload: false |
| 77 | +## |
| 78 | +## BuildOperator: |
| 79 | +## needs: [GetLatestOperatorCommitSHA] |
| 80 | +## uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main |
| 81 | +## concurrency: |
| 82 | +## group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} |
| 83 | +## cancel-in-progress: true |
| 84 | +## secrets: inherit |
| 85 | +## with: |
| 86 | +## tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} |
| 87 | +## target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} |
| 88 | +## repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} |
| 89 | +## test-image-before-upload: false |
| 90 | +## |
| 91 | +# OutputEnvVariables: |
| 92 | +## needs: [ BuildAgent, BuildOperator ] |
| 93 | +# name: 'OutputEnvVariables' |
47 | 94 | # runs-on: ubuntu-latest |
48 | 95 | # outputs: |
49 | | -# operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} |
50 | | -# operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} |
| 96 | +# CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} |
| 97 | +# CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} |
| 98 | +# CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} |
| 99 | +# ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} |
| 100 | +# ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} |
| 101 | +# ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} |
51 | 102 | # steps: |
52 | | -# - name: Checkout the target repo |
53 | | -# uses: actions/checkout@v3 |
54 | | -# with: |
55 | | -# repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} |
56 | | -# ref: ${{ inputs.operator-branch || 'main' }} |
57 | | -# path: operator-repo |
58 | 103 | # |
59 | | -# - name: Get latest commit SHA |
60 | | -# id: get_latest_sha |
| 104 | +# - name: Set output variables |
| 105 | +# id: set-outputs |
61 | 106 | # run: | |
62 | | -# cd operator-repo |
63 | | -# latest_sha=$(git rev-parse HEAD) |
64 | | -# echo "::set-output name=operator_sha::$latest_sha" |
65 | | - |
66 | | -# BuildAgent: |
67 | | -# uses: ./.github/workflows/build-test-artifacts.yml |
68 | | -# concurrency: |
69 | | -# group: "Build-Test-Artifacts-${{github.ref_name}}" |
70 | | -# cancel-in-progress: true |
71 | | -# secrets: inherit |
72 | | -# permissions: |
73 | | -# id-token: write |
74 | | -# contents: read |
75 | | -# with: |
76 | | -# test-image-before-upload: false |
77 | | -# |
78 | | -# BuildOperator: |
79 | | -# needs: [GetLatestOperatorCommitSHA] |
80 | | -# uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main |
81 | | -# concurrency: |
82 | | -# group: ${{ github.workflow }}-operator-${{ inputs.operator-branch || 'main' }} |
83 | | -# cancel-in-progress: true |
84 | | -# secrets: inherit |
85 | | -# with: |
86 | | -# tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} |
87 | | -# target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} |
88 | | -# repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} |
89 | | -# test-image-before-upload: false |
| 107 | +# { |
| 108 | +# echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" |
| 109 | +# echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" |
| 110 | +# echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" |
| 111 | +# echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" |
| 112 | +# echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" |
| 113 | +# echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" |
| 114 | +# } >> "$GITHUB_OUTPUT" |
| 115 | +# shell: bash |
| 116 | +# - name: Echo test variables |
| 117 | +# run: | |
| 118 | +# echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" |
| 119 | +# echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" |
| 120 | +# echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" |
| 121 | +# echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" |
| 122 | +# echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" |
| 123 | +# echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" |
90 | 124 | # |
91 | | - OutputEnvVariables: |
92 | | -# needs: [ BuildAgent, BuildOperator ] |
93 | | - name: 'OutputEnvVariables' |
94 | | - runs-on: ubuntu-latest |
95 | | - outputs: |
96 | | - CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }} |
97 | | - CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }} |
98 | | - CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} |
99 | | - ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }} |
100 | | - ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }} |
101 | | - ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }} |
102 | | - steps: |
103 | | - |
104 | | - - name: Set output variables |
105 | | - id: set-outputs |
106 | | - run: | |
107 | | - { |
108 | | - echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" |
109 | | - echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" |
110 | | - echo "CWA_GITHUB_TEST_REPO_BRANCH=${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}" |
111 | | - echo "ECR_INTEGRATION_TEST_REPO=cwagent-integration-test" |
112 | | - echo "ECR_OPERATOR_REPO=$(echo "${{ vars.ECR_OPERATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" |
113 | | - echo "ECR_TARGET_ALLOCATOR_REPO=$(echo "${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO }}" | awk -F'/' '{print $NF}')" |
114 | | - } >> "$GITHUB_OUTPUT" |
115 | | - shell: bash |
116 | | - - name: Echo test variables |
117 | | - run: | |
118 | | - echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}" |
119 | | - echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}" |
120 | | - echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}" |
121 | | - echo "ECR_INTEGRATION_TEST_REPO: ${{ steps.set-outputs.outputs.ECR_INTEGRATION_TEST_REPO }}" |
122 | | - echo "ECR_OPERATOR_REPO: ${{ steps.set-outputs.outputs.ECR_OPERATOR_REPO }}" |
123 | | - echo "ECR_TARGET_ALLOCATOR_REPO: ${{ steps.set-outputs.outputs.ECR_TARGET_ALLOCATOR_REPO }}" |
124 | | - |
0 commit comments