Skip to content

Commit

Permalink
Set GPU test check status for fork PRs (#3270)
Browse files Browse the repository at this point in the history
Signed-off-by: Enrico Minack <github@enrico.minack.dev>
  • Loading branch information
EnricoMi committed Nov 10, 2021
1 parent b5d121e commit 28eaf2b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ jobs:
github.event.workflow_run.head_repository.fork
steps:
- name: Create check status
continue-on-error: true
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "pending",
"context": "Build and Test GPU (on Builtkite)",
"target_url": "${{ github.event.workflow_run.html_url }}"
}'
- name: Trigger Buildkite Pipeline
id: buildkite
uses: EnricoMi/trigger-pipeline-action@master
Expand Down Expand Up @@ -110,6 +123,20 @@ jobs:
echo "::warning::Buildkite pipeline did not pass: ${{ steps.buildkite.outputs.url }}"
exit 1
- name: Update check status
if: always()
continue-on-error: true
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "${{ job.status }}",
"context": "Build and Test GPU (on Builtkite)",
"target_url": "${{ github.event.workflow_run.html_url }}"
}'
buildkite-heads:
name: "Build and Test GPU heads (on Builtkite)"
needs: [ci-workflow, buildkite]
Expand All @@ -120,6 +147,19 @@ jobs:
github.event.workflow_run.head_repository.fork
steps:
- name: Create check status
continue-on-error: true
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "pending",
"context": "Build and Test GPU heads (on Builtkite)",
"target_url": "${{ github.event.workflow_run.html_url }}"
}'
- name: Trigger Buildkite Pipeline
id: buildkite
uses: EnricoMi/trigger-pipeline-action@master
Expand Down Expand Up @@ -158,6 +198,20 @@ jobs:
echo "::warning::Buildkite pipeline did not pass: ${{ steps.buildkite.outputs.url }}"
exit 1
- name: Update check status
if: always()
continue-on-error: true
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_commit.id }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "${{ job.status }}",
"context": "Build and Test GPU heads (on Builtkite)",
"target_url": "${{ github.event.workflow_run.html_url }}"
}'
publish-test-results:
name: "Publish Unit Tests Results"
needs: [ci-workflow, buildkite, buildkite-heads]
Expand Down

0 comments on commit 28eaf2b

Please sign in to comment.