From 77348dad56f3ceb504022adc101e286ffa8826fa Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Tue, 6 Aug 2024 11:57:13 -0400 Subject: [PATCH 1/3] [chore] Replace workflow_run with workflow_dispatch --- .../application-signals-e2e-test.yml | 22 ++++++++++++++----- .github/workflows/build-test-artifacts.yml | 16 ++++++++++++++ .github/workflows/integration-test.yml | 22 ++++++++++++++----- 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/application-signals-e2e-test.yml b/.github/workflows/application-signals-e2e-test.yml index d01264d29b..0a5edbc7a6 100644 --- a/.github/workflows/application-signals-e2e-test.yml +++ b/.github/workflows/application-signals-e2e-test.yml @@ -6,10 +6,12 @@ # Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview name: Application Signals E2E Test on: - workflow_run: - workflows: [ Build Test Artifacts ] - types: - - completed + workflow_dispatch: + inputs: + build_run_id: + description: 'The ID of the build-test-artifacts workflow run' + type: number + required: true permissions: id-token: write @@ -23,9 +25,17 @@ concurrency: jobs: CheckBuildTestArtifacts: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - run: echo 'The triggering build workflow succeeded' + - run: | + conclusion=$(gh run view ${{ inputs.build_run_id }} --repo $GITHUB_REPOSITORY --json conclusion -q '.conclusion') + if [[ $conclusion == "success" ]]; then + echo "Run succeeded" + else + echo "Run failed" + exit 1 + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} java-eks-e2e-test: needs: CheckBuildTestArtifacts diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index 5eacc04c8d..3b8ec31733 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -83,3 +83,19 @@ jobs: Region: "cn-north-1" TerraformAWSAssumeRole: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }} Bucket: ${{ vars.S3_INTEGRATION_BUCKET_CN }} + + StartIntegrationTests: + needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker ] + 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 }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + StartApplicationSignalsE2ETests: + needs: [ BuildAndUpload, BuildDocker ] + 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 }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 5afd0863f4..0c9138389b 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -20,10 +20,12 @@ env: S3_INTEGRATION_BUCKET_CN: ${{ vars.S3_INTEGRATION_BUCKET_CN }} on: - workflow_run: - workflows: [ Build Test Artifacts ] - types: - - completed + workflow_dispatch: + inputs: + build_run_id: + description: 'The ID of the build-test-artifacts workflow run' + type: number + required: true concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -32,9 +34,17 @@ concurrency: jobs: CheckBuildTestArtifacts: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - run: echo 'The triggering build workflow succeeded' + - run: | + conclusion=$(gh run view ${{ inputs.build_run_id }} --repo $GITHUB_REPOSITORY --json conclusion -q '.conclusion') + if [[ $conclusion == "success" ]]; then + echo "Run succeeded" + else + echo "Run failed" + exit 1 + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GenerateTestMatrix: needs: [ CheckBuildTestArtifacts ] From bc284e67bcdb75bbdff3452b8ee60ae12d848753 Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Tue, 6 Aug 2024 12:43:55 -0400 Subject: [PATCH 2/3] Triggering on pull request --- .github/workflows/build-test-artifacts.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index 3b8ec31733..657d355037 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -3,6 +3,15 @@ name: Build Test Artifacts on: + pull_request: + branches: + - main* + - feature* + types: + - opened + - synchronize + - reopened + - ready_for_review push: branches: - main* From 99e255f84256d64a1850cc4496c2c382fe2f2b2e Mon Sep 17 00:00:00 2001 From: Jeffrey Chien Date: Tue, 6 Aug 2024 14:03:26 -0400 Subject: [PATCH 3/3] Remove pull request trigger. --- .github/workflows/build-test-artifacts.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-test-artifacts.yml b/.github/workflows/build-test-artifacts.yml index 657d355037..3b8ec31733 100644 --- a/.github/workflows/build-test-artifacts.yml +++ b/.github/workflows/build-test-artifacts.yml @@ -3,15 +3,6 @@ name: Build Test Artifacts on: - pull_request: - branches: - - main* - - feature* - types: - - opened - - synchronize - - reopened - - ready_for_review push: branches: - main*