Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,29 @@ jobs:
path: .tmp/native-dupes/jscpd-report.json
if-no-files-found: ignore

- name: Check import-direction DAG
# Structured import-direction lint over the resolved graph. See
# scripts/layering/check.ts and CONTEXT.md (Architecture: folder DAG +
# layering lint).
uses: ./.github/actions/run-gate
with: { gate: layering }
# The three graph readers each parse the whole production source tree, so each one's wait
# was the sum of the others. They read the same tree and write nothing the other reads, so
# they run as one parallel group and the job pays the slowest instead of all three.
- parallel:
# Structured import-direction lint over the resolved graph. See
# scripts/layering/check.ts and CONTEXT.md (Architecture: folder DAG +
# layering lint).
- name: Check import-direction DAG
uses: ./.github/actions/run-gate
with: { gate: layering }

# Model tests for the dependency-graph report and its blast-radius query. The report
# reads the gate's model (scripts/layering/model.ts) and applies the gate's own R6
# counting rule, so it is not a second measurement of the R6 ratchet.
- name: Check the depgraph report model
uses: ./.github/actions/run-gate
with: { gate: depgraph }
# Model tests for the dependency-graph report and its blast-radius query. The report
# reads the gate's model (scripts/layering/model.ts) and applies the gate's own R6
# counting rule, so it is not a second measurement of the R6 ratchet.
- name: Check the depgraph report model
uses: ./.github/actions/run-gate
with: { gate: depgraph }

# The selector is fail-open and advisory (GitHub CI stays authoritative),
# so the gate only guards the derivation model.
- name: Check affected-selector model
uses: ./.github/actions/run-gate
with: { gate: affected-selector }

# Tests for the TMPDIR redirection itself.
#
Expand All @@ -203,12 +213,6 @@ jobs:
uses: ./.github/actions/run-gate
with: { gate: tmpdir-leaks-model }

# The selector is fail-open and advisory (GitHub CI stays authoritative),
# so the gate only guards the derivation model.
- name: Check affected-selector model
uses: ./.github/actions/run-gate
with: { gate: affected-selector }

# The gate-of-gates (#1429). It shares this job because it validates the
# same artifact the selector is built on — CHECK_CATALOG's `ciJobs` — and
# because a gate that proves the other gates are wired must not be the one
Expand Down
27 changes: 9 additions & 18 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ concurrency:
cancel-in-progress: true

jobs:
# One job, one checkout and install: every gate below is an independent read of the tree, and
# the command-reference gate used to start its own runner and install the same graph again.
check:
name: Prose, internal links, and heading anchors
runs-on: blacksmith-4vcpu-ubuntu-2404
Expand All @@ -65,6 +67,13 @@ jobs:
- name: Setup Node and pnpm
uses: ./.github/actions/setup-node-pnpm

# ci.yml ignores docs paths, so a docs-only PR never reaches the unit lane that carries the
# command-reference coverage gate. Documenting a retired command, or dropping a public
# command's docs, fails here instead.
- name: Check command reference doc coverage
uses: ./.github/actions/run-gate
with: { gate: command-docs }

# Reads the Markdown sources only, so it fails before the site build.
- name: Check docs prose
uses: ./.github/actions/run-gate
Expand All @@ -85,21 +94,3 @@ jobs:
- name: Check docs links
uses: ./.github/actions/run-gate
with: { gate: docs-links }

# ci.yml ignores docs paths, so a docs-only PR never reaches the unit lane that carries the
# command-reference coverage gate. Documenting a retired command, or dropping a public
# command's docs, fails here instead.
command-docs:
name: Command reference doc coverage
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 5
steps:
- name: Checkout
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2

- name: Setup Node and pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Check command reference doc coverage
uses: ./.github/actions/run-gate
with: { gate: command-docs }
34 changes: 32 additions & 2 deletions .github/workflows/test-app-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,51 @@ name: Test App Build Cache
# expo-build-disk-cache provider in app.config.js.
#
# Only builds when the fingerprint has no trusted artifact yet. Runs on every
# push to main and every PR so a same-head consumer can wait for a scheduled
# producer (workflow_dispatch cannot reach a workflow that is not yet on main).
# push to main so a fingerprint is cached as soon as it lands on main, and on a
# PR whose own diff can change that fingerprint so a same-head consumer can wait
# for a scheduled producer (workflow_dispatch cannot reach a workflow that is not
# yet on main). Any other PR reuses main's artifact for the same fingerprint name,
# so a producer run there publishes a binary no consumer needs.

on:
push:
branches:
- main
pull_request:
paths:
# @expo/fingerprint hashes the Expo project with examples/test-app/ as the
# project root, so nothing above it enters the fingerprint the artifact is
# named by. The rest of the list is what this job's own steps read: the root
# manifests (the pinned pnpm version, and the second lockfile the release
# job installs), the name resolver and trust rules (setup-fixture-app), the
# dependency graph's cache key (setup-test-app-dependencies), and the
# toolchain that builds the binary (setup-node-pnpm, setup-android-sdk).
# A producer a PR needs but does not get costs that PR an inline native
# build, so this list errs toward the side that builds.
- 'examples/test-app/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/actions/setup-fixture-app/**'
- '.github/actions/setup-test-app-dependencies/**'
- '.github/actions/setup-node-pnpm/**'
- '.github/actions/setup-android-sdk/**'
- '.github/workflows/test-app-build-cache.yml'
workflow_dispatch:

permissions:
contents: read
# Look up whether this fingerprint's artifact already exists across runs.
actions: read

# A new push to the same PR supersedes this producer: a consumer trusts an artifact only from
# its own exact head or from a main push, so a binary finished for a commit no PR check still
# runs at is never downloaded. Each main commit keeps its own group, so a main build that feeds
# every later PR's cache always finishes.
concurrency:
group: >-
ci-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: true

jobs:
fingerprint:
name: Resolve native fingerprint
Expand Down
19 changes: 14 additions & 5 deletions scripts/gate/audit-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,26 @@ test('deleting the lane that runs a gate reports exactly that gate, naming the r
});

test('a docs-only change still reaches the command-reference gate (#1420)', () => {
// The docs lane declares every docs gate from one checkout, so the witness stops the whole
// lane instead of narrowing it: naming one path would also hide the lane's other gates. What
// must hold is that no other lane a docs-only PR starts runs this gate — ci.yml ignores the
// docs paths, so this lane is the gate's only path to a PR.
const category = categories(base).find((entry) => entry.rule === 'own:command-docs');
assert.ok(category, 'the command reference must still be a category');
const model = mutate((m) => ({
lanes: mapLane(
m,
(lane) => lane.workflow === 'docs.yml' && lane.gates.includes('command-docs'),
(lane) => ({ ...lane, paths: ['website/assets/**'] }),
(lane) => lane.workflow === 'docs.yml',
(lane) => ({ ...lane, pathsIgnore: ['**'] }),
),
}));
const found = messages(model);
assert.equal(found.length, 1);
assert.match(found[0] ?? '', /website\/docs\/docs\/commands\.md/);
assert.match(found[0] ?? '', /selects "command-docs"/);
assert.ok(
found.some(
(message) => message.includes(category.path) && /selects "command-docs"/.test(message),
),
`stopping the docs lane must report command-docs for ${category.path}`,
);
});

test('a path filter that excludes a category fails, though the check still runs somewhere', () => {
Expand Down
Loading