Skip to content

Commit

Permalink
[chore] Replace workflow_run with workflow_dispatch (#1274)
Browse files Browse the repository at this point in the history
  • Loading branch information
jefchien authored Aug 6, 2024
1 parent 8ea75a2 commit 5a46112
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 12 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/application-signals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build-test-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
22 changes: 16 additions & 6 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 ]
Expand Down

0 comments on commit 5a46112

Please sign in to comment.