|
| 1 | +name: Run Full CI Suite |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +jobs: |
| 8 | + trigger-full-ci: |
| 9 | + # Only run on PR comments that match the command |
| 10 | + if: | |
| 11 | + github.event.issue.pull_request && |
| 12 | + contains(github.event.comment.body, '/run-full-ci') |
| 13 | + runs-on: ubuntu-22.04 |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + pull-requests: write |
| 17 | + actions: write |
| 18 | + steps: |
| 19 | + - name: Add reaction to comment |
| 20 | + uses: peter-evans/create-or-update-comment@v4 |
| 21 | + with: |
| 22 | + comment-id: ${{ github.event.comment.id }} |
| 23 | + reactions: 'rocket' |
| 24 | + |
| 25 | + - name: Get PR details |
| 26 | + id: pr |
| 27 | + uses: actions/github-script@v7 |
| 28 | + with: |
| 29 | + script: | |
| 30 | + const pr = await github.rest.pulls.get({ |
| 31 | + owner: context.repo.owner, |
| 32 | + repo: context.repo.repo, |
| 33 | + pull_number: context.issue.number |
| 34 | + }); |
| 35 | + return { |
| 36 | + ref: pr.data.head.ref, |
| 37 | + sha: pr.data.head.sha |
| 38 | + }; |
| 39 | +
|
| 40 | + - name: Post acknowledgment comment |
| 41 | + uses: peter-evans/create-or-update-comment@v4 |
| 42 | + with: |
| 43 | + issue-number: ${{ github.event.issue.number }} |
| 44 | + body: | |
| 45 | + 🚀 **Running full CI suite** on commit `${{ fromJSON(steps.pr.outputs.result).sha }}` |
| 46 | +
|
| 47 | + This will run all CI jobs including those normally skipped on PRs: |
| 48 | + - ✅ Minimum dependency versions (Ruby 3.2, Node 20) |
| 49 | + - ✅ All example app tests |
| 50 | + - ✅ Pro package integration tests |
| 51 | + - ✅ Pro package unit tests |
| 52 | +
|
| 53 | + View progress in the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions). |
| 54 | +
|
| 55 | + - name: Trigger main workflow |
| 56 | + uses: actions/github-script@v7 |
| 57 | + with: |
| 58 | + script: | |
| 59 | + const prData = ${{ steps.pr.outputs.result }}; |
| 60 | + try { |
| 61 | + await github.rest.actions.createWorkflowDispatch({ |
| 62 | + owner: context.repo.owner, |
| 63 | + repo: context.repo.repo, |
| 64 | + workflow_id: 'main.yml', |
| 65 | + ref: prData.ref |
| 66 | + }); |
| 67 | + console.log('✅ Triggered main.yml'); |
| 68 | + } catch (error) { |
| 69 | + console.error('❌ Failed to trigger main.yml:', error.message); |
| 70 | + } |
| 71 | +
|
| 72 | + - name: Trigger examples workflow |
| 73 | + uses: actions/github-script@v7 |
| 74 | + with: |
| 75 | + script: | |
| 76 | + const prData = ${{ steps.pr.outputs.result }}; |
| 77 | + try { |
| 78 | + await github.rest.actions.createWorkflowDispatch({ |
| 79 | + owner: context.repo.owner, |
| 80 | + repo: context.repo.repo, |
| 81 | + workflow_id: 'examples.yml', |
| 82 | + ref: prData.ref |
| 83 | + }); |
| 84 | + console.log('✅ Triggered examples.yml'); |
| 85 | + } catch (error) { |
| 86 | + console.error('❌ Failed to trigger examples.yml:', error.message); |
| 87 | + } |
| 88 | +
|
| 89 | + - name: Trigger Pro integration tests |
| 90 | + uses: actions/github-script@v7 |
| 91 | + with: |
| 92 | + script: | |
| 93 | + const prData = ${{ steps.pr.outputs.result }}; |
| 94 | + try { |
| 95 | + await github.rest.actions.createWorkflowDispatch({ |
| 96 | + owner: context.repo.owner, |
| 97 | + repo: context.repo.repo, |
| 98 | + workflow_id: 'pro-integration-tests.yml', |
| 99 | + ref: prData.ref |
| 100 | + }); |
| 101 | + console.log('✅ Triggered pro-integration-tests.yml'); |
| 102 | + } catch (error) { |
| 103 | + console.error('❌ Failed to trigger pro-integration-tests.yml:', error.message); |
| 104 | + } |
| 105 | +
|
| 106 | + - name: Trigger Pro package tests |
| 107 | + uses: actions/github-script@v7 |
| 108 | + with: |
| 109 | + script: | |
| 110 | + const prData = ${{ steps.pr.outputs.result }}; |
| 111 | + try { |
| 112 | + await github.rest.actions.createWorkflowDispatch({ |
| 113 | + owner: context.repo.owner, |
| 114 | + repo: context.repo.repo, |
| 115 | + workflow_id: 'pro-package-tests.yml', |
| 116 | + ref: prData.ref |
| 117 | + }); |
| 118 | + console.log('✅ Triggered pro-package-tests.yml'); |
| 119 | + } catch (error) { |
| 120 | + console.error('❌ Failed to trigger pro-package-tests.yml:', error.message); |
| 121 | + } |
0 commit comments