mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-11 03:13:45 +00:00
Replace the 179 MB minhqnd SQLite aggregate with the 4.8 MB undertheseanlp/dictionary JSONL, pinned by commit and SHA-256, reading only rows tagged "wiktionary". The two other wordlists in that file are never read: hongocduc is GPL and would force a relicense, tudientv is an unlicensed derivative of a commercial dictionary. build-dictionary gains --merged and --sources (names validated, default wiktionary), a shared finish() tail, and meta rows for the source commit and the sources kept and excluded. The SQLite --in path, its schema auto-detection and their tests are removed. Fixture builds now record that they carry no upstream data instead of inheriting a licence string. The --min-words floor moves from 40,000 to 20,000; the corpus is 26,845 words, down from 48,216, all of the loss being words absent from the 2018 Wiktionary scrape. Capitalization is not a filter. The data licence follows the source text: CC BY-SA 3.0 Unported, which is what vi.wiktionary.org carried in 2018. LICENSE, NOTICE, ATTRIBUTION, the README, the image docs, the builder's meta string and the in-game footer all name Wiktionary tiếng Việt's contributors as the authors and undertheseanlp as the intermediary. The Makefile/Dockerfile pin test now also checks the commit the builder stamps into the database.
75 lines
2.5 KiB
YAML
75 lines
2.5 KiB
YAML
# Guards the WebSocket wire contract: the schema is well-formed, it has not
|
|
# broken compatibility, and the committed generated code matches it.
|
|
#
|
|
# The suites that decode the cross-language fixtures run in ci.yml, where the
|
|
# rest of the tests are. Nothing here downloads the upstream wordlist.
|
|
name: proto
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
contract:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# buf breaking compares against main, which needs real history.
|
|
fetch-depth: 0
|
|
|
|
- uses: bufbuild/buf-setup-action@v1
|
|
with:
|
|
version: 1.69.0
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: server/go.mod
|
|
cache-dependency-path: server/go.sum
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- run: npm ci
|
|
working-directory: web
|
|
|
|
- name: Lint the schema
|
|
run: buf lint
|
|
|
|
# Skipped only until this contract first lands on main; after that the
|
|
# baseline always exists and the check is unconditional.
|
|
- name: Look for a breaking-change baseline on main
|
|
id: baseline
|
|
run: |
|
|
if git cat-file -e origin/main:proto/noitu/v1/game.proto 2>/dev/null; then
|
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::no schema on main yet, skipping the breaking-change check"
|
|
fi
|
|
|
|
# ref=origin/main, not branch=main: a pull_request checkout is a detached
|
|
# HEAD with no local main, and branch=main fails there with a git clone
|
|
# error rather than a breaking-change report.
|
|
- name: Reject breaking changes
|
|
if: steps.baseline.outputs.exists == 'true'
|
|
run: buf breaking --against '.git#ref=origin/main'
|
|
|
|
# A committed generated tree that no longer matches the schema is worse
|
|
# than no generated tree at all: it compiles, and it is wrong.
|
|
# --intent-to-add first: git diff ignores untracked files, so without it
|
|
# a plugin that starts emitting a new file passes this check while the
|
|
# committed tree is incomplete.
|
|
- name: Verify the committed generated code is in sync
|
|
run: |
|
|
buf generate
|
|
git add --intent-to-add -- server/gen web/src/lib/proto
|
|
git diff --exit-code -- server/gen web/src/lib/proto
|