actions/checkout v4 -> v7, actions/setup-node v4 -> v7 and pnpm/action-setup v4 -> v6. Also bumps the two pins in .github/actions/setup-workspace, which dependabot's github-actions updater never proposed: `directory: /` scans .github/workflows only, so a composite action's own `uses:` lines are invisible to it. Left alone they would have kept the repo on setup-node v4 in every lane that goes through the composite — which is every lane except the checkout steps themselves.
78 lines
2.7 KiB
YAML
78 lines
2.7 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/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
|