|
56 | 56 | }); |
57 | 57 | core.setOutput('sha', pr.head.sha); |
58 | 58 |
|
| 59 | + - name: Set checks to pending |
| 60 | + uses: actions/github-script@v7 |
| 61 | + with: |
| 62 | + script: | |
| 63 | + const sha = '${{ steps.get-sha.outputs.sha }}'; |
| 64 | + const checks = ['Lint', 'Build C++ (ubuntu-22.04)', 'Build C++ (ubuntu-24.04)', 'Build C++ (macos-14)', 'Validate']; |
| 65 | + for (const check of checks) { |
| 66 | + await github.rest.repos.createCommitStatus({ |
| 67 | + owner: context.repo.owner, |
| 68 | + repo: context.repo.repo, |
| 69 | + sha, |
| 70 | + state: 'pending', |
| 71 | + context: check, |
| 72 | + description: 'Waiting...', |
| 73 | + }); |
| 74 | + } |
| 75 | +
|
59 | 76 |
|
60 | 77 | lint: |
61 | 78 | name: Lint |
|
77 | 94 | with: |
78 | 95 | args: "check engine/ --ignore E501 --exit-zero" |
79 | 96 |
|
| 97 | + - name: Report status |
| 98 | + if: always() |
| 99 | + uses: actions/github-script@v7 |
| 100 | + with: |
| 101 | + script: | |
| 102 | + await github.rest.repos.createCommitStatus({ |
| 103 | + owner: context.repo.owner, |
| 104 | + repo: context.repo.repo, |
| 105 | + sha: '${{ needs.slash-command.outputs.pr-sha }}', |
| 106 | + state: '${{ job.status }}' === 'success' ? 'success' : 'failure', |
| 107 | + context: 'Lint', |
| 108 | + description: '${{ job.status }}', |
| 109 | + }); |
| 110 | +
|
80 | 111 |
|
81 | 112 | build-cpp: |
82 | 113 | name: Build C++ (${{ matrix.os }}) |
@@ -125,6 +156,20 @@ jobs: |
125 | 156 | path: quadtrix |
126 | 157 | retention-days: 7 |
127 | 158 |
|
| 159 | + - name: Report status |
| 160 | + if: always() |
| 161 | + uses: actions/github-script@v7 |
| 162 | + with: |
| 163 | + script: | |
| 164 | + await github.rest.repos.createCommitStatus({ |
| 165 | + owner: context.repo.owner, |
| 166 | + repo: context.repo.repo, |
| 167 | + sha: '${{ needs.slash-command.outputs.pr-sha }}', |
| 168 | + state: '${{ job.status }}' === 'success' ? 'success' : 'failure', |
| 169 | + context: 'Build C++ (${{ matrix.os }})', |
| 170 | + description: '${{ job.status }}', |
| 171 | + }); |
| 172 | +
|
128 | 173 |
|
129 | 174 | validate: |
130 | 175 | name: Validate |
@@ -171,6 +216,20 @@ jobs: |
171 | 216 | dockerfile: .devops/Dockerfile.backend |
172 | 217 | failure-threshold: error |
173 | 218 |
|
| 219 | + - name: Report status |
| 220 | + if: always() |
| 221 | + uses: actions/github-script@v7 |
| 222 | + with: |
| 223 | + script: | |
| 224 | + await github.rest.repos.createCommitStatus({ |
| 225 | + owner: context.repo.owner, |
| 226 | + repo: context.repo.repo, |
| 227 | + sha: '${{ needs.slash-command.outputs.pr-sha }}', |
| 228 | + state: '${{ job.status }}' === 'success' ? 'success' : 'failure', |
| 229 | + context: 'Validate', |
| 230 | + description: '${{ job.status }}', |
| 231 | + }); |
| 232 | +
|
174 | 233 |
|
175 | 234 | post-result: |
176 | 235 | name: Post result |
|
0 commit comments