Skip to content

Commit

Permalink
Dispatch workflow instead of calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
mbg committed Jul 9, 2024
1 parent a6a2f05 commit 8ff5888
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/go-tests-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: "Go: Run Tests"
on:
workflow_dispatch:
pull_request:
workflow_call:
inputs:
ref:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/go-tests-other-os.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "Go: Run Tests - Other OS"
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,28 @@ jobs:
run-linux-tests:
name: "Go: Run Linux tests"
runs-on: ubuntu-latest
needs:
- prepare-go-tests
uses: ./.github/workflows/go-tests-linux.yml
secrets: inherit
with:
ref: ${{ needs.prepare-go-tests.outputs.ref }}
steps:
- name: Dispatch test workflow
shell: bash
run: |
gh workflow run "go-tests-linux.yml" --repo "${{ github.repository }}" --ref "${{ github.head_ref || github.ref_name }}" --json
env:
GH_TOKEN: ${{ github.token }}

run-other-os-tests:
name: "Go: Run other OS tests"
runs-on: ubuntu-latest
# Only run this workflow for PRs and only if something other than .ql files changed
if: github.event_name == 'pull_request' && !(needs.prepare-go-tests.outputs.onlyQL == 'true')
needs:
- prepare-go-tests
uses: ./.github/workflows/go-tests-other-os.yml
secrets: inherit
with:
ref: ${{ needs.prepare-go-tests.outputs.ref }}
steps:
- name: Dispatch test workflow
shell: bash
run: |
gh workflow run "go-tests-other-os.yml" --repo "${{ github.repository }}" --ref "${{ github.head_ref }}" --json
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 8ff5888

Please sign in to comment.