|
7 | 7 | # request opened against its parent branch is exactly the one that |
8 | 8 | # most needs checking, and it was getting none. |
9 | 9 | pull_request: |
10 | | - # The full suite every night, whatever changed. Pull requests run only what |
11 | | - # their change can affect (see `changes` below), and the vulnerability |
12 | | - # database moves without any commit: govulncheck lives in this workflow, so |
13 | | - # without a schedule a new advisory surfaced only when someone next pushed. |
14 | 10 | schedule: |
15 | 11 | - cron: '23 5 * * *' |
16 | 12 | workflow_dispatch: |
17 | 13 |
|
18 | | -# A new push to a pull request supersedes the run in flight. Pushes to main, |
19 | | -# the schedule and dispatches never cancel, and each gets a group of its own: |
20 | | -# a group holds one running and one pending run, so a shared one would let a |
21 | | -# newer main push replace a queued nightly run even with cancel-in-progress off. |
22 | 14 | concurrency: |
23 | 15 | group: ${{ github.event_name == 'pull_request' && format('test-pr-{0}', github.event.pull_request.number) || format('test-run-{0}', github.run_id) }} |
24 | 16 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
25 | 17 |
|
26 | 18 | permissions: {} |
27 | 19 |
|
28 | 20 | jobs: |
29 | | - # What this run has to check. Only a pull request is ever narrowed: a push |
30 | | - # to main, the nightly schedule and a dispatch always answer "everything". |
31 | | - # |
32 | | - # go anything outside the two lists below: the whole suite. |
33 | | - # tests only skill or eval files: Tests and Integration Tests, which read |
34 | | - # the embedded skill, its drift fixtures and the eval patterns. Lint, |
35 | | - # Security, CLI Surface Check and the race shards cannot see a |
36 | | - # Markdown or YAML change, so they skip. |
37 | | - # (neither) only prose that nothing builds, embeds or tests: Tests runs its |
38 | | - # naming check and nothing else. |
39 | | - # |
40 | | - # Fail-safe by construction. A path narrows the run only if it is listed |
41 | | - # here, so a file nobody thought about runs everything, and this file is on |
42 | | - # neither list, so a change to the gating runs everything too. |
43 | | - # |
44 | | - # Required checks keep reporting. The gated jobs below skip with a job-level |
45 | | - # `if`, and GitHub counts a job skipped by its condition as a passing check. |
46 | | - # A workflow-level `paths` filter would not run the workflow at all and would |
47 | | - # leave every required check pending forever. And a classifier that fails or |
48 | | - # answers nothing narrows nothing: the gates test `!= 'false'`, under |
49 | | - # `!cancelled()`, so an empty answer runs the job. |
50 | 21 | changes: |
51 | 22 | name: Classify changes |
52 | 23 | runs-on: ubuntu-latest |
53 | 24 | permissions: |
54 | 25 | contents: read |
55 | | - pull-requests: read # dorny/paths-filter enumerates PR files via the REST API |
| 26 | + pull-requests: read |
56 | 27 | outputs: |
57 | 28 | go: ${{ steps.decide.outputs.go }} |
58 | 29 | tests: ${{ steps.decide.outputs.tests }} |
|
62 | 33 | if: github.event_name == 'pull_request' |
63 | 34 | uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 |
64 | 35 | with: |
65 | | - # `every`: a file counts for a filter only if it matches all of that |
66 | | - # filter's patterns, so '**' plus negations reads "any file outside |
67 | | - # these lists". |
68 | 36 | predicate-quantifier: every |
69 | 37 | filters: | |
70 | 38 | go: |
|
92 | 60 | exit 0 |
93 | 61 | fi |
94 | 62 |
|
95 | | - # A classifier that cannot tell must not be allowed to say "skip". |
96 | 63 | for answer in "$GO" "$TESTS"; do |
97 | 64 | case "$answer" in |
98 | 65 | true|false) ;; |
|
117 | 84 | name: Tests |
118 | 85 | runs-on: ubuntu-latest |
119 | 86 | needs: changes |
120 | | - # Always runs: the naming check covers Markdown, so a prose-only change |
121 | | - # still has something here to answer for. Only the Go steps are gated. |
122 | 87 | if: ${{ !cancelled() }} |
123 | 88 | permissions: |
124 | 89 | contents: read |
@@ -305,8 +270,7 @@ jobs: |
305 | 270 | runs-on: ubuntu-latest |
306 | 271 | needs: [changes, race-shard] |
307 | 272 | # always(), or a failed shard would skip this job — and a skipped required |
308 | | - # check is not a failed one. The one skip that is meant: a pull request |
309 | | - # whose change the shards cannot see, where they skipped by design too. |
| 273 | + # check is not a failed one. |
310 | 274 | if: ${{ always() && needs.changes.outputs.go != 'false' }} |
311 | 275 | permissions: |
312 | 276 | contents: read |
|
0 commit comments