Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End-to-End Build Workflow #1416

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build-test-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -87,6 +93,7 @@ jobs:

StartIntegrationTests:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ]
if: ${{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 }}
Expand All @@ -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}}
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 }}
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/e2e-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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"
ECR_TARGET_ALLOCATOR_STAGING_REPO: ${{ vars.ECR_TARGET_ALLOCATOR_STAGING_REPO}}
ECR_OPERATOR_RELEASE_IMAGE: ${{ vars.ECR_TARGET_ALLOCATOR_TEST_OPERATOR_REPO}}

on:
workflow_dispatch:
inputs:
operator-branch:
required: true
type: string
default: 'main'
workflow_call:
inputs:
operator-branch:
required: true
type: string
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@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



Loading