Skip to content
Merged
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
25 changes: 24 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
pull_request:
paths:
- "action.yaml"
- ".github/workflows/target-workflow.yaml"
- ".github/workflows/integration-tests.yaml"
push:
branches: ["main"]
tags: ["*"]
paths:
- "action.yaml"
- ".github/workflows/target-workflow.yaml"
- ".github/workflows/integration-tests.yaml"

jobs:
Expand Down Expand Up @@ -66,8 +74,23 @@ jobs:
job_id: ${{ steps.wait-for-job-named.outputs.job-id }}
conclusion: ${{ steps.wait-for-job-named.outputs.conclusion }}

setup-build-workflow:
name: Setup Build Workflow
# These permissions are needed to:
# - Create a workflow dispatch event: https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Initiate target workflow
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
workflow: target-workflow.yaml
ref: ${{ github.head_ref || github.ref_name }} # Workflow dispatch only works on branches or tags

test-build-workflow:
name: Test Build Workflow
needs: setup-build-workflow
# These permissions are needed to:
# - Checkout the repo
permissions:
Expand All @@ -79,7 +102,7 @@ jobs:
id: workflow-run
with:
workflow-file: target-workflow.yaml
commit-sha: ${{ github.event.pull_request.head.sha }}
commit-sha: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: ./
id: wait-for-job
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/target-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
name: Target Workflow
on:
pull_request:
paths:
- "action.yaml"
- ".github/workflows/integration-tests.yaml"
workflow_dispatch: {}

jobs:
build:
Expand Down
Loading