Skip to content

Commit b5bf7d5

Browse files
committed
Add integration-tests-gate to be able to share common Required check
1 parent 6c69227 commit b5bf7d5

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

.github/workflows/ci-fork-integration.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
if: >-
2525
${{ github.event.action == 'synchronize'
2626
&& github.event.pull_request.head.repo.full_name != github.repository }}
27-
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
27+
runs-on: 'blacksmith-2vcpu-ubuntu-2204'
2828
permissions:
2929
# Needed for removing the "safe-to-test" label
3030
pull-requests: write
@@ -43,7 +43,7 @@ jobs:
4343
${{ github.event.action == 'labeled'
4444
&& github.event.label.name == 'safe-to-test'
4545
&& github.event.pull_request.head.repo.full_name != github.repository }}
46-
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
46+
runs-on: 'blacksmith-2vcpu-ubuntu-2204'
4747
permissions:
4848
pull-requests: write
4949
name: Check Label Sender Permissions
@@ -288,3 +288,28 @@ jobs:
288288
name: playwright-traces-fork-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.sanitize.outputs.artifact-suffix }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}
289289
path: test-results
290290
retention-days: 1
291+
292+
integration-tests-gate:
293+
needs: [integration-tests]
294+
if: ${{ always() && needs.integration-tests.result != 'skipped' }}
295+
runs-on: 'blacksmith-2vcpu-ubuntu-2204'
296+
permissions:
297+
statuses: write
298+
name: Fork Integration Tests Gate
299+
steps:
300+
- name: Report integration test status
301+
env:
302+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
303+
RESULT: ${{ needs.integration-tests.result }}
304+
SHA: ${{ github.event.pull_request.head.sha }}
305+
REPO: ${{ github.repository }}
306+
run: |
307+
if [ "$RESULT" = "success" ]; then
308+
STATE="success"
309+
else
310+
STATE="failure"
311+
fi
312+
gh api "repos/$REPO/statuses/$SHA" \
313+
-f state="$STATE" \
314+
-f context="integration-tests" \
315+
-f description="Fork integration tests: $RESULT"

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,34 @@ jobs:
481481
path: test-results
482482
retention-days: 1
483483

484+
integration-tests-gate:
485+
needs: [integration-tests]
486+
if: >-
487+
${{ always()
488+
&& github.event_name == 'pull_request'
489+
&& needs.integration-tests.result != 'skipped' }}
490+
runs-on: "blacksmith-2vcpu-ubuntu-2204"
491+
permissions:
492+
statuses: write
493+
name: Integration Tests Gate
494+
steps:
495+
- name: Report integration test status
496+
env:
497+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
498+
RESULT: ${{ needs.integration-tests.result }}
499+
SHA: ${{ github.event.pull_request.head.sha }}
500+
REPO: ${{ github.repository }}
501+
run: |
502+
if [ "$RESULT" = "success" ]; then
503+
STATE="success"
504+
else
505+
STATE="failure"
506+
fi
507+
gh api "repos/$REPO/statuses/$SHA" \
508+
-f state="$STATE" \
509+
-f context="integration-tests" \
510+
-f description="Integration tests: $RESULT"
511+
484512
pkg-pr-new:
485513
name: Publish with pkg-pr-new
486514
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}

0 commit comments

Comments
 (0)