Skip to content

Make the roadmap auto-add idempotent #78

Make the roadmap auto-add idempotent

Make the roadmap auto-add idempotent #78

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Typecheck, Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck (frontend + server)
run: bun run typecheck
# The notification DB tests spin up mongodb-memory-server. No system
# `mongod` on the runner, so it downloads one — cache it across runs.
- name: Cache mongodb-memory-server binary
uses: actions/cache@v4
with:
path: ~/.cache/mongodb-binaries
key: mongodb-binaries-${{ runner.os }}
- name: Test
run: bun run test
- name: Build frontend
run: bun run build
- name: Check i18n locale key parity
run: |
node --input-type=module -e '
import { readFileSync, readdirSync } from "fs";
const dir = "src/messages";
const files = readdirSync(dir).filter(f => f.endsWith(".json"));
const keysByFile = Object.fromEntries(
files.map(f => [f, new Set(Object.keys(JSON.parse(readFileSync(`${dir}/${f}`, "utf8"))))])
);
const ref = keysByFile["en.json"];
let failed = false;
for (const [file, keys] of Object.entries(keysByFile)) {
const missing = [...ref].filter(k => !keys.has(k));
const extra = [...keys].filter(k => !ref.has(k));
if (missing.length || extra.length) {
failed = true;
console.error(`${file}: missing=${JSON.stringify(missing)} extra=${JSON.stringify(extra)}`);
}
}
if (failed) process.exit(1);
console.log(`All ${files.length} locales have matching keys (${ref.size} keys).`);
'