diff --git a/.github/actions/ecosystem_ci_dispatch/action.yaml b/.github/actions/ecosystem_ci_dispatch/action.yaml index 8868a996..512d040c 100644 --- a/.github/actions/ecosystem_ci_dispatch/action.yaml +++ b/.github/actions/ecosystem_ci_dispatch/action.yaml @@ -35,13 +35,13 @@ inputs: outputs: workflow-id: description: 'ID of the triggered downstream workflow run' - value: ${{ steps.eco_ci.outputs.workflow_id }} + value: ${{ steps.dispatch.outputs.run_id }} workflow-url: description: 'URL of the triggered downstream workflow run' - value: ${{ steps.eco_ci.outputs.workflow_url }} + value: ${{ steps.dispatch.outputs.run_url }} conclusion: description: 'Conclusion reported by the downstream workflow' - value: ${{ steps.eco_ci.outputs.conclusion }} + value: ${{ steps.eco_ci.outcome }} summary: description: 'Formatted markdown summary of downstream job results' value: ${{ steps.eco-ci-result.outputs.summary }} @@ -114,17 +114,29 @@ runs: }) return comment.id + - id: dispatch + name: Dispatch Ecosystem CI + uses: Codex-/return-dispatch@16fa9d14771c4d56ae0196bbda1d3c17f7f3650f # v3.0.2 + continue-on-error: true + with: + token: ${{ inputs.github-token }} + ref: ci/dockerless-workflow-dispatch + owner: rstackjs + repo: rstack-ecosystem-ci + workflow: ${{ inputs.workflow-file }} + workflow_inputs: ${{ inputs.client-payload }} + - id: eco_ci - name: Run Ecosystem CI - uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5 + name: Await Ecosystem CI + uses: Codex-/await-remote-run@2512346665df8818ec7ad6aca3cdceb7626cd384 # v2.0.0 continue-on-error: true with: + token: ${{ inputs.github-token }} owner: rstackjs repo: rstack-ecosystem-ci - workflow_file_name: ${{ inputs.workflow-file }} - ref: main - github_token: ${{ inputs.github-token }} - client_payload: ${{ inputs.client-payload }} + run_id: ${{ steps.dispatch.outputs.run_id }} + run_timeout_seconds: 10800 + poll_interval_ms: 30000 - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -137,7 +149,7 @@ runs: with: job-prefix: ${{ inputs.job-name-prefix }} heading: ${{ inputs.ecosystem-repo }} - workflow-output: ${{ toJson(steps.eco_ci.outputs) }} + workflow-output: '{"run_id": "${{ steps.dispatch.outputs.run_id }}"}' - id: update-comment name: Update Comment diff --git a/.github/actions/ecosystem_ci_per_commit/action.yaml b/.github/actions/ecosystem_ci_per_commit/action.yaml index 0d76b834..1b9c7d57 100644 --- a/.github/actions/ecosystem_ci_per_commit/action.yaml +++ b/.github/actions/ecosystem_ci_per_commit/action.yaml @@ -27,13 +27,13 @@ inputs: outputs: workflow-id: description: 'ID of the triggered downstream workflow run' - value: ${{ steps.eco_ci.outputs.workflow_id }} + value: ${{ steps.dispatch.outputs.run_id }} workflow-url: description: 'URL of the triggered downstream workflow run' - value: ${{ steps.eco_ci.outputs.workflow_url }} + value: ${{ steps.dispatch.outputs.run_url }} conclusion: description: 'Conclusion reported by the downstream workflow' - value: ${{ steps.eco_ci.outputs.conclusion }} + value: ${{ steps.eco_ci.outcome }} summary: description: 'Formatted markdown summary of downstream job results' value: ${{ steps.eco-ci-result.outputs.summary }} @@ -44,17 +44,29 @@ outputs: runs: using: composite steps: - - name: Run Ecosystem CI with notify + - name: Dispatch Ecosystem CI + id: dispatch + continue-on-error: true + uses: Codex-/return-dispatch@16fa9d14771c4d56ae0196bbda1d3c17f7f3650f # v3.0.2 + with: + token: ${{ inputs.github-token }} + ref: 'main' + owner: rstackjs + repo: rstack-ecosystem-ci + workflow: ${{ inputs.workflow-file }} + workflow_inputs: ${{ inputs.client-payload }} + + - name: Await Ecosystem CI id: eco_ci continue-on-error: true - uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5 + uses: Codex-/await-remote-run@2512346665df8818ec7ad6aca3cdceb7626cd384 # v2.0.0 with: + token: ${{ inputs.github-token }} owner: rstackjs repo: rstack-ecosystem-ci - workflow_file_name: ${{ inputs.workflow-file }} - github_token: ${{ inputs.github-token }} - ref: 'main' - client_payload: ${{ inputs.client-payload }} + run_id: ${{ steps.dispatch.outputs.run_id }} + run_timeout_seconds: 10800 + poll_interval_ms: 30000 - name: Get CI Result id: eco-ci-result @@ -62,7 +74,7 @@ runs: with: job-prefix: ${{ inputs.job-name-prefix }} heading: ${{ inputs.ecosystem-repo }} - workflow-output: ${{ toJson(steps.eco_ci.outputs) }} + workflow-output: '{"run_id": "${{ steps.dispatch.outputs.run_id }}"}' - id: create-commit-comment uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 diff --git a/.github/workflows/rspack-ecosystem-ci-from-pr.yml b/.github/workflows/rspack-ecosystem-ci-from-pr.yml index 3b798b1e..fdd274fa 100644 --- a/.github/workflows/rspack-ecosystem-ci-from-pr.yml +++ b/.github/workflows/rspack-ecosystem-ci-from-pr.yml @@ -55,8 +55,22 @@ on: required: true type: string default: 'precoded' + distinct_id: + description: 'Distinct ID injected by return-dispatch to identify this run' + required: false + type: string + default: '' jobs: + return-dispatch-id: + name: Return Dispatch ID + runs-on: ubuntu-latest + steps: + - name: Return Dispatch ID ${{ inputs.distinct_id }} + run: echo "${DISTINCT_ID}" + env: + DISTINCT_ID: ${{ inputs.distinct_id }} + get-runner-labels: name: Get Runner Labels uses: ./.github/workflows/get-runner-labels.yml