From 187aff03e1700d8774d6254551bfdfd0c96ceb43 Mon Sep 17 00:00:00 2001 From: musa-asad Date: Fri, 13 Dec 2024 15:26:35 -0500 Subject: [PATCH 1/3] Make changes. --- .github/workflows/build-test-artifacts.yml | 5 ----- .github/workflows/integration-test.yml | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index 6348e286cc..cf04006851 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -16,11 +16,6 @@ on: - '!.github/workflows/integration-test.yml' - '!.github/workflows/application-signals-e2e-test.yml' workflow_dispatch: - inputs: - test-image-before-upload: - description: "Run Test on the new container image" - default: true - type: boolean workflow_call: inputs: test-image-before-upload: diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 811ee5ece6..18936b8eb5 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -91,7 +91,7 @@ jobs: - name: Generate matrix id: set-matrix run: | - go run generator/test_case_generator.go + go run --tags=generator generator/test_case_generator.go echo "::set-output name=ec2_gpu_matrix::$(echo $(cat generator/resources/ec2_gpu_complete_test_matrix.json))" echo "::set-output name=eks_addon_matrix::$(echo $(cat generator/resources/eks_addon_complete_test_matrix.json))" echo "::set-output name=ec2_linux_matrix::$(echo $(cat generator/resources/ec2_linux_complete_test_matrix.json))" From ad90d9eec84194f2bea2b8f2e49fa9844597da46 Mon Sep 17 00:00:00 2001 From: okankoAMZ <107267850+okankoAMZ@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:00:03 -0800 Subject: [PATCH 2/3] End-to-End Build Workflow (#1416) Co-authored-by: Musa --- .github/workflows/build-test-artifacts.yml | 9 ++- .github/workflows/e2e-build.yml | 68 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e-build.yml diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index ca12788fc7..e5fdb5cfd9 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -16,6 +16,12 @@ on: - '!.github/workflows/integration-test.yml' - '!.github/workflows/application-signals-e2e-test.yml' workflow_dispatch: + workflow_call: + inputs: + test-image-before-upload: + description: "Run Test on the new container image" + default: true + type: boolean concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -87,6 +93,7 @@ jobs: StartIntegrationTests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] + if: ${{inputs.test-image-before-upload == null || inputs.test-image-before-upload}} runs-on: ubuntu-latest steps: - run: gh workflow run integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} @@ -96,7 +103,7 @@ jobs: StartApplicationSignalsE2ETests: needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] # Workflow only runs against main - if: ${{ contains(github.ref_name, 'main') }} + if: ${{ contains(github.ref_name, 'main') && (inputs.test-image-before-upload == null ||inputs.test-image-before-upload) }} runs-on: ubuntu-latest steps: - run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }} diff --git a/.github/workflows/e2e-build.yml b/.github/workflows/e2e-build.yml new file mode 100644 index 0000000000..3acba7112f --- /dev/null +++ b/.github/workflows/e2e-build.yml @@ -0,0 +1,68 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT + +name: Build End-to-End Test Artifacts +env: + OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" +on: + workflow_dispatch: + inputs: + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + workflow_call: + inputs: + operator-branch: + required: false + type: string + description: 'Branch of the operator to test' + default: 'main' + +jobs: + GetLatestOperatorCommitSHA: + runs-on: ubuntu-latest + outputs: + operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} + operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} + steps: + - name: Checkout the target repo + uses: actions/checkout@v3 + with: + repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} + ref: ${{inputs.operator-branch}} + path: operator-repo + + - name: Get latest commit SHA + id: get_latest_sha + run: | + cd operator-repo + latest_sha=$(git rev-parse HEAD) + echo "::set-output name=operator_sha::$latest_sha" + BuildAgent: + uses: ./.github/workflows/build-test-artifacts.yml + concurrency: + group: "Build-Test-Artifacts-${{github.ref_name}}" + cancel-in-progress: true + secrets: inherit + permissions: + id-token: write + contents: read + with: + test-image-before-upload: false + BuildOperator: + needs: [GetLatestOperatorCommitSHA] + uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main + concurrency: + group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}} + cancel-in-progress: true + secrets: inherit + with: + tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} + repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} + test-image-before-upload: false + + + From 2a67460c3c88f0317bb82c628eb46c61cce4af1b Mon Sep 17 00:00:00 2001 From: musa-asad Date: Fri, 13 Dec 2024 16:10:02 -0500 Subject: [PATCH 3/3] Remove e2e-build.yml. --- .github/workflows/e2e-build.yml | 68 --------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .github/workflows/e2e-build.yml diff --git a/.github/workflows/e2e-build.yml b/.github/workflows/e2e-build.yml deleted file mode 100644 index 3acba7112f..0000000000 --- a/.github/workflows/e2e-build.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: MIT - -name: Build End-to-End Test Artifacts -env: - OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator" -on: - workflow_dispatch: - inputs: - operator-branch: - required: false - type: string - description: 'Branch of the operator to test' - default: 'main' - workflow_call: - inputs: - operator-branch: - required: false - type: string - description: 'Branch of the operator to test' - default: 'main' - -jobs: - GetLatestOperatorCommitSHA: - runs-on: ubuntu-latest - outputs: - operator_commit_sha: ${{steps.get_latest_sha.outputs.operator_sha}} - operator_repo_name: ${{env.OPERATOR_GITHUB_REPO_NAME}} - steps: - - name: Checkout the target repo - uses: actions/checkout@v3 - with: - repository: ${{env.OPERATOR_GITHUB_REPO_NAME}} - ref: ${{inputs.operator-branch}} - path: operator-repo - - - name: Get latest commit SHA - id: get_latest_sha - run: | - cd operator-repo - latest_sha=$(git rev-parse HEAD) - echo "::set-output name=operator_sha::$latest_sha" - BuildAgent: - uses: ./.github/workflows/build-test-artifacts.yml - concurrency: - group: "Build-Test-Artifacts-${{github.ref_name}}" - cancel-in-progress: true - secrets: inherit - permissions: - id-token: write - contents: read - with: - test-image-before-upload: false - BuildOperator: - needs: [GetLatestOperatorCommitSHA] - uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@main - concurrency: - group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}} - cancel-in-progress: true - secrets: inherit - with: - tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - target-sha: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}} - repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}} - test-image-before-upload: false - - -