Update T5 E-paper S3 Pro and add Pro V2 details #444
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - v2 | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - v2 | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Biome | |
| uses: biomejs/setup-biome@v2 | |
| with: | |
| version: latest | |
| - name: Run Biome | |
| run: biome ci | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| # Match engines.node and the deployment runtime. "latest" resolved to Node 26, where | |
| # buffer.SlowBuffer is gone and the octokit -> jwa import chain throws on load, so the | |
| # server could not boot at all on the version CI was testing -- while the version we | |
| # actually ship was never exercised. | |
| node-version: "22" | |
| - name: Install Dependencies | |
| run: pnpm install --ignore-scripts=false | |
| - name: Validate maintenanceUf2.json | |
| run: pnpm validate:maintenance-uf2 | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| # Match engines.node and the deployment runtime. "latest" resolved to Node 26, where | |
| # buffer.SlowBuffer is gone and the octokit -> jwa import chain throws on load, so the | |
| # server could not boot at all on the version CI was testing -- while the version we | |
| # actually ship was never exercised. | |
| node-version: "22" | |
| - name: Install Dependencies | |
| run: pnpm install --ignore-scripts=false | |
| - name: Build Package | |
| run: pnpm build | |
| # A green build only proved tsc exited 0. In #121 it did exactly that while emitting the | |
| # entry point to dist/src/index.js, so `start` hit a missing file and every deploy after it | |
| # crash-looped. This step runs what the platform runs and waits for a real response, which | |
| # catches both a relocated entry point and anything that dies during boot. | |
| - name: Check the built server boots and serves | |
| run: | | |
| test -f dist/index.js || { | |
| echo "::error::dist/index.js is missing -- start runs this exact path" | |
| find dist -name index.js | |
| exit 1 | |
| } | |
| node dist/index.js & | |
| server=$! | |
| for _ in $(seq 1 30); do | |
| if curl -fsS -o /dev/null "http://127.0.0.1:${PORT}/"; then | |
| echo "server answered GET / on port ${PORT}" | |
| kill "$server" | |
| exit 0 | |
| fi | |
| if ! kill -0 "$server" 2>/dev/null; then | |
| echo "::error::server exited during boot without serving a request" | |
| exit 1 | |
| fi | |
| sleep 1 | |
| done | |
| echo "::error::server never answered GET / within 30s" | |
| kill "$server" | |
| exit 1 | |
| env: | |
| PORT: 4000 | |
| # The v2 static pipeline. Runs alongside the jobs above, which still gate the tinyhttp server | |
| # that Railway serves until the flip. When the server is deleted, `quality` and `build` go with | |
| # it and this becomes the whole of CI. | |
| static: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # build-data derives deviceLinks' generatedAt from `git log`, so it needs real history. | |
| # With the default shallow clone it throws rather than silently stamping something wrong. | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile --ignore-scripts=false | |
| # build:data FIRST. worker/src/generated/ is gitignored -- it is a pure function of the | |
| # tree, so committing it would be a second source of truth -- which means a fresh checkout | |
| # does not have it and `tsc` cannot resolve ./generated/documents.js until it is built. | |
| - name: Build the published documents | |
| run: pnpm build:data | |
| # typecheck:v2 covers worker/ and tools/ only. The root `tsc --noEmit` takes in src/**, the | |
| # tinyhttp server, whose types are not resolvable until `prisma generate` has run -- that is | |
| # the `build` job's concern, and it already does exactly that. Running it here made the | |
| # static pipeline fail on the legacy server's Prisma types depending on whether the | |
| # postinstall generate had happened. | |
| - name: Typecheck the v2 tree | |
| run: pnpm typecheck:v2 | |
| - name: Validate data | |
| run: pnpm validate | |
| # The build must be a pure function of the tree: no clock, no network, no environment. | |
| # Anything non-deterministic here would make byte-parity unprovable and turn every publish | |
| # into a spurious diff. | |
| - name: Build is deterministic | |
| run: | | |
| set -euo pipefail | |
| rm -rf /tmp/gen-a | |
| cp -R worker/src/generated /tmp/gen-a | |
| pnpm build:data | |
| diff -r /tmp/gen-a worker/src/generated | |
| # Scoped to the two FROZEN captures only. A byte-exact gate over all generated output would | |
| # go red on this repo's single most common PR (adding a board) and on every hourly | |
| # deviceLinks commit -- and because deploy.yml runs the same check, it would block every R2 | |
| # update an hour after cutover. | |
| - name: Frozen objects have not drifted | |
| run: shasum -a 256 -c tests/golden/frozen.sha256 | |
| - name: Router contract tests | |
| run: pnpm test | |
| - name: Stage the R2 objects | |
| run: pnpm build:static | |
| - name: Worker bundles and stays within budget | |
| run: | | |
| set -euo pipefail | |
| pnpm exec wrangler deploy --dry-run --outdir=.dry --env staging | |
| size=$(cat .dry/*.js | wc -c) | |
| echo "bundle: ${size} bytes" | |
| test "$size" -lt 2097152 |