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
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
check-and-build:
name: Check & Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

# Every check below runs even if an earlier one failed, so a single CI
# run reports every problem at once.
- name: Check formatting
if: ${{ !cancelled() }}
run: pnpm format:check

- name: Type check
if: ${{ !cancelled() }}
run: pnpm check

- name: Build
if: ${{ !cancelled() }}
run: pnpm build
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Ordered queue: each item is one focused PR, and earlier items are prerequisites
- Gap: the site is on Astro 5.15, `@astrojs/mdx` 4, TypeScript 5, `prettier-plugin-astro` 0.14, and `prettier-plugin-tailwindcss` 0.7, with no Node or pnpm version pinned. `@astrojs/rss` is installed but no feed exists, and `@astrojs/check` sits in `dependencies`. The i18next removal above has shipped, so nothing blocks the upgrade.
- Scope (one toolchain change, kept whole): bump `astro` to `^7.3.7`, `@astrojs/mdx` to `^8.0.3`, `@astrojs/sitemap` to `^3.7.4`, `tailwindcss`/`@tailwindcss/vite` to `^4.3.3`, `@tailwindcss/typography` to `^0.5.20`, `typescript` to `^6.0.3`, `prettier` to `^3.9.9`, `prettier-plugin-astro` to `^1.1.0`, and `prettier-plugin-tailwindcss` to `^0.8.1`. Move `@astrojs/check` (`^0.9.10`) to `devDependencies`. Remove the unused `@astrojs/rss`. Add `"engines": {"node": ">=22.19.0"}`, `"packageManager": "pnpm@11.22.0"`, `.nvmrc` (`22.19.0`), and a `pnpm-workspace.yaml` (`packages: ["."]`, `allowBuilds: {esbuild: true, sharp: true}`) so pnpm 11 runs the required build scripts. Add `// @ts-check` and `output: "static"` to `astro.config.mjs`. Change `preview` to `astro build && astro preview`. Regenerate `pnpm-lock.yaml` and re-run `pnpm format` if the new plugin versions change formatting.
- Acceptance: `pnpm install --frozen-lockfile` succeeds on Node 22.19+ with pnpm 11. Check, `format:check`, and build pass with no new warnings. `dist/` still contains `index.html` and `sitemap-index.xml`.
- [ ] **Add a Check & Build GitHub Actions workflow**
- [x] **Add a Check & Build GitHub Actions workflow**
- Gap: no CI exists, so formatting, type errors, and build failures are only caught locally. Its prerequisites have shipped: `package.json` has the `format:check` and `check` scripts and pins `packageManager: pnpm@11.22.0`, which `pnpm/action-setup` reads. Node 24 satisfies `engines.node` (`>=22.19.0`).
- Scope: add `.github/workflows/test.yml`, named `Test` with job `Check & Build`, triggered on pull requests to and pushes to `main`. Steps: `actions/checkout@v7`, `pnpm/action-setup@v6` (reads `packageManager`), `actions/setup-node@v7` with `node-version: "24"` and `cache: "pnpm"`, then `pnpm install --frozen-lockfile`. Run `pnpm format:check`, `pnpm check`, and `pnpm build` as separate steps, each with `if: ${{ !cancelled() }}` so one run reports every failure.
- Acceptance: the workflow passes on its own PR. Validate the YAML locally by running the three commands in order.
Expand Down
Loading