|
14 | 14 | UV_VERSION: '0.8.8' |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - # Gate - if this exact commit already passed on another branch (recorded as a |
18 | | - # build-result status) then skip the main job below. Runs on the same runner |
19 | | - # pool as the build so we don't reintroduce a wait on the hosted queue. |
| 17 | + # Skip the build if this commit already passed on another branch. |
20 | 18 | dedup: |
21 | | - runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'self-hosted' || 'ubuntu-latest' }} |
| 19 | + uses: ./.github/workflows/dedup.yml |
22 | 20 | permissions: |
23 | | - statuses: read |
24 | | - outputs: |
25 | | - already_built: ${{ steps.check.outputs.already_built }} |
26 | | - steps: |
27 | | - - name: Look for an existing build-result status on this commit |
28 | | - id: check |
29 | | - env: |
30 | | - GH_TOKEN: ${{ github.token }} |
31 | | - run: | |
32 | | - body=$(curl -fsS \ |
33 | | - -H "Authorization: Bearer ${GH_TOKEN}" \ |
34 | | - -H "Accept: application/vnd.github+json" \ |
35 | | - "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/status") |
36 | | - if echo "$body" | grep -Eq '"context"[[:space:]]*:[[:space:]]*"build-result"' |
37 | | - then |
38 | | - echo "already_built=true" >> "$GITHUB_OUTPUT" |
39 | | - else |
40 | | - echo "already_built=false" >> "$GITHUB_OUTPUT" |
41 | | - fi |
| 21 | + actions: read |
| 22 | + with: |
| 23 | + workflow_file: build.yml |
42 | 24 |
|
43 | 25 | test: |
44 | 26 | needs: dedup |
45 | 27 | permissions: |
46 | 28 | contents: read |
47 | | - statuses: write |
48 | 29 | # Run on our own runner for trusted sources (push/dispatch, or a same-repo |
49 | 30 | # PR); fork PRs fall back to the hosted runner so they never touch it. |
50 | 31 | runs-on: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && 'self-hosted' || 'ubuntu-latest' }} |
|
92 | 73 | - name: Run Playwright end-to-end tests |
93 | 74 | run: | |
94 | 75 | sh tests/run-playwright.sh |
95 | | -
|
96 | | - - name: Record a build-result status for this commit |
97 | | - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} |
98 | | - env: |
99 | | - GH_TOKEN: ${{ github.token }} |
100 | | - run: | |
101 | | - curl -fsS -X POST \ |
102 | | - -H "Authorization: Bearer ${GH_TOKEN}" \ |
103 | | - -H "Accept: application/vnd.github+json" \ |
104 | | - "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \ |
105 | | - -d "{\"state\":\"success\",\"context\":\"build-result\",\"description\":\"Build and test passed\",\"target_url\":\"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}\"}" |
0 commit comments