|
33 | 33 | branches: |
34 | 34 | - main |
35 | 35 | workflow_dispatch: |
36 | | - |
| 36 | + inputs: |
| 37 | + pr_number: |
| 38 | + description: 'Pull request number' |
| 39 | + required: false |
| 40 | + type: string |
| 41 | + check_run_id: |
| 42 | + description: 'Check run ID for status updates' |
| 43 | + required: false |
| 44 | + type: string |
| 45 | + pr_head_sha: |
| 46 | + description: 'PR head SHA' |
| 47 | + required: false |
| 48 | + type: string |
| 49 | + |
| 50 | +permissions: |
| 51 | + contents: read |
| 52 | + checks: write |
37 | 53 |
|
38 | 54 | jobs: |
39 | 55 |
|
@@ -132,5 +148,44 @@ jobs: |
132 | 148 | cargo test --profile release-nonlto --test sqllogictests -- --include-sqlite |
133 | 149 | cargo clean |
134 | 150 |
|
| 151 | + # If the workflow was triggered by the PR comment we need to manually update check status to display in UI |
| 152 | + update-check-status: |
| 153 | + needs: [linux-build-lib, linux-test-extended, hash-collisions, sqllogictest-sqlite] |
| 154 | + runs-on: ubuntu-latest |
| 155 | + if: ${{ always() && github.event_name == 'workflow_dispatch' }} |
| 156 | + steps: |
| 157 | + - name: Determine workflow status |
| 158 | + id: status |
| 159 | + run: | |
| 160 | + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then |
| 161 | + echo "workflow_status=failure" >> $GITHUB_OUTPUT |
| 162 | + echo "conclusion=failure" >> $GITHUB_OUTPUT |
| 163 | + else |
| 164 | + echo "workflow_status=completed" >> $GITHUB_OUTPUT |
| 165 | + echo "conclusion=success" >> $GITHUB_OUTPUT |
| 166 | + fi |
| 167 | + |
| 168 | + - name: Update check run |
| 169 | + uses: actions/github-script@v7 |
| 170 | + with: |
| 171 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 172 | + script: | |
| 173 | + const workflowRunUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; |
| 174 | + |
| 175 | + await github.rest.checks.update({ |
| 176 | + owner: context.repo.owner, |
| 177 | + repo: context.repo.repo, |
| 178 | + check_run_id: ${{ github.event.inputs.check_run_id }}, |
| 179 | + status: 'completed', |
| 180 | + conclusion: '${{ steps.status.outputs.conclusion }}', |
| 181 | + output: { |
| 182 | + title: '${{ steps.status.outputs.conclusion == 'success' && 'Extended Tests Passed' || 'Extended Tests Failed' }}', |
| 183 | + summary: `Extended tests have completed with status: ${{ steps.status.outputs.conclusion }}.\n\n[View workflow run](${workflowRunUrl})` |
| 184 | + }, |
| 185 | + details_url: workflowRunUrl |
| 186 | + }); |
| 187 | +
|
| 188 | +
|
| 189 | +
|
135 | 190 |
|
136 | 191 |
|
0 commit comments