Skip to content

Commit

Permalink
[chore] Separate build jobs for artifacts and trigger tests with work…
Browse files Browse the repository at this point in the history
…flow_run (#1269)
  • Loading branch information
jefchien authored Aug 5, 2024
1 parent d517dc5 commit dab6b24
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 118 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/application-signals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
# This is a reusable workflow for running the E2E test for Application Signals.
# It is meant to be called from another workflow.
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
name: E2E Testing
name: Application Signals E2E Test
on:
workflow_call:
workflow_run:
workflows: [ Build Test Artifacts ]
types:
- completed

permissions:
id-token: write
Expand All @@ -18,7 +21,14 @@ concurrency:


jobs:
CheckBuildTestArtifacts:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The triggering build workflow succeeded'

java-eks-e2e-test:
needs: CheckBuildTestArtifacts
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-e2e-test.yml@main
secrets: inherit
with:
Expand All @@ -27,21 +37,23 @@ jobs:
caller-workflow-name: 'main-build'

java-ec2-default-e2e-test:
needs: CheckBuildTestArtifacts
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-e2e-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

java-ec2-asg-e2e-test:
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-e2e-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

java-metric-limiter-e2e-test:
needs: [ java-eks-e2e-test ]
needs: [ CheckBuildTestArtifacts, java-eks-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-metric-limiter-e2e-test.yml@main
secrets: inherit
with:
Expand All @@ -50,14 +62,15 @@ jobs:
caller-workflow-name: 'main-build'

java-k8s-e2e-test:
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-e2e-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-eks-e2e-test:
needs: [ java-metric-limiter-e2e-test ]
needs: [ CheckBuildTestArtifacts, java-metric-limiter-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-eks-e2e-test.yml@main
secrets: inherit
with:
Expand All @@ -66,21 +79,23 @@ jobs:
caller-workflow-name: 'main-build'

python-ec2-default-e2e-test:
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-default-e2e-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-ec2-asg-e2e-test:
needs: [ CheckBuildTestArtifacts ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-ec2-asg-e2e-test.yml@main
secrets: inherit
with:
aws-region: us-east-1
caller-workflow-name: 'main-build'

python-k8s-e2e-test:
needs: [ java-k8s-e2e-test ]
needs: [ CheckBuildTestArtifacts, java-k8s-e2e-test ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/python-k8s-e2e-test.yml@main
secrets: inherit
with:
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/build-test-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: Build Test Artifacts
on:
push:
branches:
- main*
paths-ignore:
- '**/*.md'
- 'NOTICE'
- 'RELEASE_NOTES'
- 'THIRD-PARTY'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/build-test-artifacts.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
BuildAndUpload:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET }}

BuildAndUploadPackages:
uses: ./.github/workflows/test-build-packages.yml
needs: [BuildAndUpload]
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET }}

BuildDocker:
needs: [BuildAndUpload]
uses: ./.github/workflows/test-build-docker.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
ContainerRepositoryNameAndTag: "cwagent-integration-test:${{ github.sha }}"
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"

BuildAndUploadITAR:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
Region: "us-gov-east-1"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET_ITAR }}

BuildAndUploadCN:
uses: ./.github/workflows/test-build.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
BucketKey: "integration-test/binary/${{ github.sha }}"
PackageBucketKey: "integration-test/packaging/${{ github.sha }}"
Region: "cn-north-1"
TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }}
Bucket: ${{ vars.S3_INTEGRATION_BUCKET_CN }}
Loading

0 comments on commit dab6b24

Please sign in to comment.