@airshiplabs/cli's npm page reads "This package does not have a README" while a 400-line one sits at the repo root. npm renders the README from the PACKAGE directory, and apps/cli has never had one — pnpm copies the root LICENSE into a workspace package that lacks one, but it does not do the same for README. Copying it verbatim is not enough: npm resolves relative links against repository.directory (apps/cli), where media/cover.png does not exist, so all seven screenshots would 404. scripts/sync-readme.mjs rewrites them to absolute GitHub URLs — raw.githubusercontent for images, since the blob view serves HTML, and blob for everything else. The output is committed rather than built on demand, like apps/web/src/routeTree.gen.ts, so a clean checkout can publish without running the generator. Two guards keep it honest: checks.yml fails a PR when it is stale, and verify-tarball.sh now asserts README.md is in the tarball, so a README-less publish cannot happen twice.
88 lines
3.2 KiB
YAML
88 lines
3.2 KiB
YAML
name: Checks
|
|
|
|
run-name: "Checks · ${{ github.head_ref || github.ref_name }}"
|
|
|
|
# The PR gate. Mirrors `make preflight` locally, with one deliberate difference:
|
|
# typecheck and test are scoped with `turbo --affected` against the PR base,
|
|
# which locally there is no base to diff against.
|
|
#
|
|
# Drafts are skipped. `ready_for_review` is in the trigger list so marking a PR
|
|
# ready re-runs this rather than leaving it permanently unchecked.
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: checks-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
# turbo --affected diffs against the PR base; it needs full history.
|
|
fetch-depth: 0
|
|
|
|
- uses: ./.github/actions/setup-workspace
|
|
|
|
- name: Lint (Biome via Ultracite)
|
|
run: pnpm lint
|
|
|
|
- name: Typecheck + test (affected)
|
|
env:
|
|
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }}
|
|
run: |
|
|
if [ -n "${TURBO_SCM_BASE}" ]; then
|
|
pnpm turbo run typecheck test --affected
|
|
else
|
|
pnpm turbo run typecheck test
|
|
fi
|
|
|
|
# apps/cli/README.md is generated from the root README.md, and it is what
|
|
# npmjs.com renders for @airshiplabs/cli. Committed rather than built on
|
|
# demand so a clean checkout can publish without running the generator.
|
|
- name: README is not stale
|
|
run: |
|
|
if ! node scripts/sync-readme.mjs --check; then
|
|
echo "::error file=apps/cli/README.md::The CLI README is stale. Run 'make readme' and commit the result."
|
|
exit 1
|
|
fi
|
|
|
|
# apps/web/src/routeTree.gen.ts is generated but committed, so it drifts.
|
|
# Regenerated by BUILDING, not by `tsr generate`: two things write this
|
|
# file and they disagree — the router CLI emits the tree alone, while the
|
|
# Start Vite plugin appends the `declare module` block that registers the
|
|
# router type for SSR. The build's output is the committed one.
|
|
- name: Route tree is not stale
|
|
run: |
|
|
pnpm turbo run build --filter=@airship/web
|
|
if ! git diff --quiet -- apps/web/src/routeTree.gen.ts; then
|
|
git diff --stat -- apps/web/src/routeTree.gen.ts
|
|
echo "::error file=apps/web/src/routeTree.gen.ts::The route tree is stale. Run 'make web:build' and commit the result."
|
|
exit 1
|
|
fi
|
|
|
|
commitlint:
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: ./.github/actions/setup-workspace
|
|
|
|
# .husky/commit-msg runs the same rule, but a hook is only ever a
|
|
# courtesy — `--no-verify` skips it. This is the copy that counts.
|
|
- name: Conventional Commits
|
|
run: |
|
|
pnpm commitlint \
|
|
--from "${{ github.event.pull_request.base.sha }}" \
|
|
--to "${{ github.event.pull_request.head.sha }}" \
|
|
--verbose
|