Skip to content

Commit

Permalink
Merge build and test for e2e.
Browse files Browse the repository at this point in the history
  • Loading branch information
musa-asad committed Dec 1, 2024
1 parent ff14103 commit adf6e6d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 73 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/e2e-build.yml

This file was deleted.

49 changes: 43 additions & 6 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
CWA_GITHUB_TEST_REPO_BRANCH: "e2e"
TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }}
TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }}
OPERATOR_GITHUB_REPO_NAME: "aws/amazon-cloudwatch-agent-operator"

on:
push:
Expand Down Expand Up @@ -39,17 +40,53 @@ concurrency:
cancel-in-progress: true

jobs:
SetUpE2EEnvironment:
uses: ./.github/workflows/e2e-build.yml
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:
operator-branch: ${{ inputs.operator-branch }}
test-image-before-upload: false

BuildOperator:
needs: [GetLatestOperatorCommitSHA]
uses: aws/amazon-cloudwatch-agent-operator/.github/workflows/build-and-upload.yml@e2e-testing
concurrency:
group: ${{ github.workflow }}-operator-${{ inputs.operator-branch}}
cancel-in-progress: true
secrets: inherit
with:
tag: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
target-branch: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha}}
repository: ${{needs.GetLatestOperatorCommitSHA.outputs.operator_repo_name}}
test-image-before-upload: false

GenerateTestMatrix:
needs: [ SetUpE2EEnvironment ]
needs: [BuildAgent, BuildOperator]
name: 'GenerateTestMatrix'
runs-on: ubuntu-latest
outputs:
Expand All @@ -76,9 +113,9 @@ jobs:
echo "eks_e2e_matrix: ${{ steps.set-matrix.outputs.eks_e2e_matrix }}"
EKSE2EJMXTest:
needs: [ GenerateTestMatrix ]
needs: [GenerateTestMatrix]
name: 'EKSE2EJMX'
uses: ./.github/workflows/eks-e2e-test.yml
uses: ./.github/workflows/eks-e2e-test.yml
with:
terraform_dir: terraform/eks/e2e
job_id: eks-e2e-jmx-test
Expand Down

0 comments on commit adf6e6d

Please sign in to comment.