Skip to content

Commit edf483f

Browse files
authored
ci: swap Docker trigger-workflow-and-wait for JS workflow_dispatch (#64)
1 parent ecca2c8 commit edf483f

3 files changed

Lines changed: 58 additions & 20 deletions

File tree

.github/actions/ecosystem_ci_dispatch/action.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ inputs:
3535
outputs:
3636
workflow-id:
3737
description: 'ID of the triggered downstream workflow run'
38-
value: ${{ steps.eco_ci.outputs.workflow_id }}
38+
value: ${{ steps.dispatch.outputs.run_id }}
3939
workflow-url:
4040
description: 'URL of the triggered downstream workflow run'
41-
value: ${{ steps.eco_ci.outputs.workflow_url }}
41+
value: ${{ steps.dispatch.outputs.run_url }}
4242
conclusion:
4343
description: 'Conclusion reported by the downstream workflow'
44-
value: ${{ steps.eco_ci.outputs.conclusion }}
44+
value: ${{ steps.eco_ci.outcome }}
4545
summary:
4646
description: 'Formatted markdown summary of downstream job results'
4747
value: ${{ steps.eco-ci-result.outputs.summary }}
@@ -114,17 +114,29 @@ runs:
114114
})
115115
return comment.id
116116
117+
- id: dispatch
118+
name: Dispatch Ecosystem CI
119+
uses: Codex-/return-dispatch@16fa9d14771c4d56ae0196bbda1d3c17f7f3650f # v3.0.2
120+
continue-on-error: true
121+
with:
122+
token: ${{ inputs.github-token }}
123+
ref: ci/dockerless-workflow-dispatch
124+
owner: rstackjs
125+
repo: rstack-ecosystem-ci
126+
workflow: ${{ inputs.workflow-file }}
127+
workflow_inputs: ${{ inputs.client-payload }}
128+
117129
- id: eco_ci
118-
name: Run Ecosystem CI
119-
uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5
130+
name: Await Ecosystem CI
131+
uses: Codex-/await-remote-run@2512346665df8818ec7ad6aca3cdceb7626cd384 # v2.0.0
120132
continue-on-error: true
121133
with:
134+
token: ${{ inputs.github-token }}
122135
owner: rstackjs
123136
repo: rstack-ecosystem-ci
124-
workflow_file_name: ${{ inputs.workflow-file }}
125-
ref: main
126-
github_token: ${{ inputs.github-token }}
127-
client_payload: ${{ inputs.client-payload }}
137+
run_id: ${{ steps.dispatch.outputs.run_id }}
138+
run_timeout_seconds: 10800
139+
poll_interval_ms: 30000
128140

129141
- name: Checkout
130142
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -137,7 +149,7 @@ runs:
137149
with:
138150
job-prefix: ${{ inputs.job-name-prefix }}
139151
heading: ${{ inputs.ecosystem-repo }}
140-
workflow-output: ${{ toJson(steps.eco_ci.outputs) }}
152+
workflow-output: '{"run_id": "${{ steps.dispatch.outputs.run_id }}"}'
141153

142154
- id: update-comment
143155
name: Update Comment

.github/actions/ecosystem_ci_per_commit/action.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ inputs:
2727
outputs:
2828
workflow-id:
2929
description: 'ID of the triggered downstream workflow run'
30-
value: ${{ steps.eco_ci.outputs.workflow_id }}
30+
value: ${{ steps.dispatch.outputs.run_id }}
3131
workflow-url:
3232
description: 'URL of the triggered downstream workflow run'
33-
value: ${{ steps.eco_ci.outputs.workflow_url }}
33+
value: ${{ steps.dispatch.outputs.run_url }}
3434
conclusion:
3535
description: 'Conclusion reported by the downstream workflow'
36-
value: ${{ steps.eco_ci.outputs.conclusion }}
36+
value: ${{ steps.eco_ci.outcome }}
3737
summary:
3838
description: 'Formatted markdown summary of downstream job results'
3939
value: ${{ steps.eco-ci-result.outputs.summary }}
@@ -44,25 +44,37 @@ outputs:
4444
runs:
4545
using: composite
4646
steps:
47-
- name: Run Ecosystem CI with notify
47+
- name: Dispatch Ecosystem CI
48+
id: dispatch
49+
continue-on-error: true
50+
uses: Codex-/return-dispatch@16fa9d14771c4d56ae0196bbda1d3c17f7f3650f # v3.0.2
51+
with:
52+
token: ${{ inputs.github-token }}
53+
ref: 'main'
54+
owner: rstackjs
55+
repo: rstack-ecosystem-ci
56+
workflow: ${{ inputs.workflow-file }}
57+
workflow_inputs: ${{ inputs.client-payload }}
58+
59+
- name: Await Ecosystem CI
4860
id: eco_ci
4961
continue-on-error: true
50-
uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5
62+
uses: Codex-/await-remote-run@2512346665df8818ec7ad6aca3cdceb7626cd384 # v2.0.0
5163
with:
64+
token: ${{ inputs.github-token }}
5265
owner: rstackjs
5366
repo: rstack-ecosystem-ci
54-
workflow_file_name: ${{ inputs.workflow-file }}
55-
github_token: ${{ inputs.github-token }}
56-
ref: 'main'
57-
client_payload: ${{ inputs.client-payload }}
67+
run_id: ${{ steps.dispatch.outputs.run_id }}
68+
run_timeout_seconds: 10800
69+
poll_interval_ms: 30000
5870

5971
- name: Get CI Result
6072
id: eco-ci-result
6173
uses: rstackjs/rstack-ecosystem-ci/.github/actions/ecosystem-ci-result@3cbb84659edaf3713e10831715d39de0d5c02df7 # main
6274
with:
6375
job-prefix: ${{ inputs.job-name-prefix }}
6476
heading: ${{ inputs.ecosystem-repo }}
65-
workflow-output: ${{ toJson(steps.eco_ci.outputs) }}
77+
workflow-output: '{"run_id": "${{ steps.dispatch.outputs.run_id }}"}'
6678

6779
- id: create-commit-comment
6880
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9

.github/workflows/rspack-ecosystem-ci-from-pr.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,22 @@ on:
5555
required: true
5656
type: string
5757
default: 'precoded'
58+
distinct_id:
59+
description: 'Distinct ID injected by return-dispatch to identify this run'
60+
required: false
61+
type: string
62+
default: ''
5863

5964
jobs:
65+
return-dispatch-id:
66+
name: Return Dispatch ID
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Return Dispatch ID ${{ inputs.distinct_id }}
70+
run: echo "${DISTINCT_ID}"
71+
env:
72+
DISTINCT_ID: ${{ inputs.distinct_id }}
73+
6074
get-runner-labels:
6175
name: Get Runner Labels
6276
uses: ./.github/workflows/get-runner-labels.yml

0 commit comments

Comments
 (0)