From aed0c70c5895267937255b95ef7a0f768caec00f Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 16:08:41 +0200 Subject: [PATCH 01/10] ci: split CI into tiered fast-check/docs-check/deep-check jobs plus nightly maintenance workflow --- .forgejo/workflows/ci.yml | 144 +++++++++++++++++++++++++-------- .forgejo/workflows/nightly.yml | 34 ++++++++ 2 files changed, 145 insertions(+), 33 deletions(-) create mode 100644 .forgejo/workflows/nightly.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 5a877404..60961c75 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -2,18 +2,120 @@ name: CI on: push: - branches: - - main + branches: [main] + paths-ignore: + - 'README.md' + - '.agents/**' + - '.claude/**' + - '.changeset/**' pull_request: + paths-ignore: + - 'README.md' + - '.agents/**' + - '.claude/**' + - '.changeset/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - ci: + changes: + name: Detect changed areas runs-on: docker container: image: oven/bun:1.3.14 - + outputs: + docs: ${{ steps.filter.outputs.docs }} steps: - - name: Install Git, Node.js, and CA Certificates + - name: Install Git + run: | + apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates + git config --global --add safe.directory '*' + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Detect docs-relevant changes + id: filter + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + BASE="${{ github.event.pull_request.base.sha }}" + else + BASE="${{ github.event.before }}" + fi + # No usable base (first push to a branch, force-push, shallow edge case): run docs-check to be safe. + if [ -z "$BASE" ] || ! git cat-file -e "$BASE" 2>/dev/null; then + echo "docs=true" >> "$GITHUB_OUTPUT" + elif git diff --name-only "$BASE" HEAD | grep -qE '^packages/(docs|renderer)/'; then + echo "docs=true" >> "$GITHUB_OUTPUT" + else + echo "docs=false" >> "$GITHUB_OUTPUT" + fi + + fast-check: + name: Fast Check + runs-on: docker + container: + image: oven/bun:1.3.14 + steps: + - name: Install Git + run: | + apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates + git config --global --add safe.directory '*' + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: bun install --frozen-lockfile --ignore-scripts + + - name: Build Core Packages + run: | + bun run build --filter='!@gram-lang/docs' + git diff --exit-code packages/parser/src/grammar-content.ts + + - name: Lint, Typecheck & Ratchet + run: | + bun run lint + bun run typecheck + bun run any-ratchet + + - name: Unit Tests + run: bun test + + docs-check: + name: Docs Build + needs: changes + if: needs.changes.outputs.docs == 'true' + runs-on: docker + container: + image: oven/bun:1.3.14 + steps: + - name: Install Git + run: | + apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates + git config --global --add safe.directory '*' + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: bun install --frozen-lockfile --ignore-scripts + + - name: Build Docs + run: bun run build --filter='@gram-lang/docs' + + deep-check-and-publish: + name: Conformance, Smoke & Publish + needs: fast-check + runs-on: docker + container: + image: oven/bun:1.3.14 + steps: + - name: Install Git, Node.js & Tools run: | apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates curl git config --global --add safe.directory '*' @@ -26,41 +128,17 @@ jobs: run: bun install --frozen-lockfile --ignore-scripts - name: Build - run: | - bun run build --filter='!@gram-lang/docs' - git diff --exit-code packages/parser/src/grammar-content.ts + run: bun run build --filter='!@gram-lang/docs' - - name: Build docs - run: bun run build --filter='@gram-lang/docs' - - - name: Lint - run: bun run lint - - - name: Typecheck - run: bun run typecheck - - - name: Any Ratchet - run: bun run any-ratchet - - - name: Test - run: bun test - - - name: Conformance + - name: Conformance Suite run: bun run conformance - - name: Content audit - run: bun run audit - continue-on-error: true - - - name: Audit dependencies - run: bun audit --audit-level=high - - - name: Pack CLI dependencies + - name: Pack CLI Packages run: | mkdir -p .smoke for p in i18n format parser modules kitchen analyzer renderer cli; do (cd packages/$p && bun pm pack --destination ../../.smoke); done - - name: Node smoke tests + - name: Node.js Smoke Tests run: | export REPO_DIR=$(pwd) mkdir -p /tmp/smoke-install && cd /tmp/smoke-install diff --git a/.forgejo/workflows/nightly.yml b/.forgejo/workflows/nightly.yml new file mode 100644 index 00000000..47a64fdc --- /dev/null +++ b/.forgejo/workflows/nightly.yml @@ -0,0 +1,34 @@ +name: Nightly Maintenance & Audit + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +jobs: + security-and-audit: + name: Security, Deduplication & Vocabulary Audit + runs-on: docker + container: + image: oven/bun:1.3.14 + steps: + - name: Install Git + run: | + apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates + git config --global --add safe.directory '*' + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: bun install --frozen-lockfile --ignore-scripts + + - name: Lockfile Deduplication Check + run: bun run dedupe:check + + - name: Dependencies CVE Audit + run: bun audit --audit-level=high + + - name: Content Vocabulary Audit + run: bun run audit + continue-on-error: true -- 2.54.0 From 480e1c7ac4c62aef662b0526e2eaa4fdc47b847b Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 16:39:21 +0200 Subject: [PATCH 02/10] ci: merge fast-check and deep-check-and-publish back into one job to stop duplicating setup/build --- .forgejo/workflows/ci.yml | 51 ++++++++++++--------------------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 60961c75..d6ce82f7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -55,37 +55,6 @@ jobs: echo "docs=false" >> "$GITHUB_OUTPUT" fi - fast-check: - name: Fast Check - runs-on: docker - container: - image: oven/bun:1.3.14 - steps: - - name: Install Git - run: | - apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates - git config --global --add safe.directory '*' - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install dependencies - run: bun install --frozen-lockfile --ignore-scripts - - - name: Build Core Packages - run: | - bun run build --filter='!@gram-lang/docs' - git diff --exit-code packages/parser/src/grammar-content.ts - - - name: Lint, Typecheck & Ratchet - run: | - bun run lint - bun run typecheck - bun run any-ratchet - - - name: Unit Tests - run: bun test - docs-check: name: Docs Build needs: changes @@ -108,9 +77,8 @@ jobs: - name: Build Docs run: bun run build --filter='@gram-lang/docs' - deep-check-and-publish: - name: Conformance, Smoke & Publish - needs: fast-check + ci: + name: Build, Test & Publish runs-on: docker container: image: oven/bun:1.3.14 @@ -127,8 +95,19 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile --ignore-scripts - - name: Build - run: bun run build --filter='!@gram-lang/docs' + - name: Build Core Packages + run: | + bun run build --filter='!@gram-lang/docs' + git diff --exit-code packages/parser/src/grammar-content.ts + + - name: Lint, Typecheck & Ratchet + run: | + bun run lint + bun run typecheck + bun run any-ratchet + + - name: Unit Tests + run: bun test - name: Conformance Suite run: bun run conformance -- 2.54.0 From 2c3680919288af4625f878b6aadbd5f2021a4043 Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 16:49:21 +0200 Subject: [PATCH 03/10] ci: collapse changes/docs-check into one job, cache bun and turbo between runs --- .forgejo/workflows/ci.yml | 90 ++++++++++++++------------------------- 1 file changed, 33 insertions(+), 57 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index d6ce82f7..8a991ced 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -20,63 +20,6 @@ concurrency: cancel-in-progress: true jobs: - changes: - name: Detect changed areas - runs-on: docker - container: - image: oven/bun:1.3.14 - outputs: - docs: ${{ steps.filter.outputs.docs }} - steps: - - name: Install Git - run: | - apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates - git config --global --add safe.directory '*' - - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Detect docs-relevant changes - id: filter - run: | - if [ "${{ github.event_name }}" = "pull_request" ]; then - BASE="${{ github.event.pull_request.base.sha }}" - else - BASE="${{ github.event.before }}" - fi - # No usable base (first push to a branch, force-push, shallow edge case): run docs-check to be safe. - if [ -z "$BASE" ] || ! git cat-file -e "$BASE" 2>/dev/null; then - echo "docs=true" >> "$GITHUB_OUTPUT" - elif git diff --name-only "$BASE" HEAD | grep -qE '^packages/(docs|renderer)/'; then - echo "docs=true" >> "$GITHUB_OUTPUT" - else - echo "docs=false" >> "$GITHUB_OUTPUT" - fi - - docs-check: - name: Docs Build - needs: changes - if: needs.changes.outputs.docs == 'true' - runs-on: docker - container: - image: oven/bun:1.3.14 - steps: - - name: Install Git - run: | - apt-get update -qq && apt-get install -y -qq --no-install-recommends git ca-certificates - git config --global --add safe.directory '*' - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install dependencies - run: bun install --frozen-lockfile --ignore-scripts - - - name: Build Docs - run: bun run build --filter='@gram-lang/docs' - ci: name: Build, Test & Publish runs-on: docker @@ -91,6 +34,35 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Detect docs-relevant changes + id: filter + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + BASE="${{ github.event.pull_request.base.sha }}" + else + BASE="${{ github.event.before }}" + fi + # No usable base (first push to a branch, force-push, shallow edge case): run docs build to be safe. + if [ -z "$BASE" ] || ! git cat-file -e "$BASE" 2>/dev/null; then + echo "docs=true" >> "$GITHUB_OUTPUT" + elif git diff --name-only "$BASE" HEAD | grep -qE '^packages/(docs|renderer)/'; then + echo "docs=true" >> "$GITHUB_OUTPUT" + else + echo "docs=false" >> "$GITHUB_OUTPUT" + fi + + - name: Cache Bun & Turbo + uses: actions/cache@v4 + with: + path: | + ~/.bun/install/cache + .turbo + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- - name: Install dependencies run: bun install --frozen-lockfile --ignore-scripts @@ -100,6 +72,10 @@ jobs: bun run build --filter='!@gram-lang/docs' git diff --exit-code packages/parser/src/grammar-content.ts + - name: Build Docs + if: steps.filter.outputs.docs == 'true' + run: bun run build --filter='@gram-lang/docs' + - name: Lint, Typecheck & Ratchet run: | bun run lint -- 2.54.0 From 6b06da845c7e71386346912d7cb4b9b8eae8f99a Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 16:57:46 +0200 Subject: [PATCH 04/10] ci: trigger a second run to verify bun/turbo cache restore behavior -- 2.54.0 From 8c55a5e1acc234b5b73d7fdedc44b5709ac6ab4a Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:02:37 +0200 Subject: [PATCH 05/10] ci: revert actions/cache, no functioning cache storage backend on this Forgejo instance --- .forgejo/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 8a991ced..0ed13ee4 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -54,16 +54,6 @@ jobs: echo "docs=false" >> "$GITHUB_OUTPUT" fi - - name: Cache Bun & Turbo - uses: actions/cache@v4 - with: - path: | - ~/.bun/install/cache - .turbo - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- - - name: Install dependencies run: bun install --frozen-lockfile --ignore-scripts -- 2.54.0 From 7292b4239ee2c841a36c8646603166e0ade07f04 Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:06:03 +0200 Subject: [PATCH 06/10] ci: add temporary diagnostic step for actions cache connectivity --- .forgejo/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 0ed13ee4..d1ced9ec 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -37,6 +37,16 @@ jobs: with: fetch-depth: 0 + - name: Debug Actions Cache connectivity + run: | + env | grep -i "ACTIONS_" || echo "no ACTIONS_ env vars found" + if [ -n "$ACTIONS_CACHE_URL" ]; then + echo "Cache URL is set, testing reachability from inside the job container:" + curl -v --max-time 5 "$ACTIONS_CACHE_URL" || echo "UNREACHABLE from job container" + else + echo "ACTIONS_CACHE_URL is empty: the cache server is not enabled in the runner's config.yaml" + fi + - name: Detect docs-relevant changes id: filter run: | -- 2.54.0 From a653ad1dab7b4318a8a0c53200c8f04177c7d5f9 Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:21:31 +0200 Subject: [PATCH 07/10] ci: retest actions cache connectivity after runner network_mode:host fix -- 2.54.0 From 3ae434541990a33ad16ad29ca631d780419dff35 Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:46:58 +0200 Subject: [PATCH 08/10] ci: retest actions cache connectivity after switching to a dedicated docker network -- 2.54.0 From 573ac9e4e774295f7b9f1bf1c9dae24060a3be18 Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:49:45 +0200 Subject: [PATCH 09/10] ci: re-enable bun/turbo cache now that the runner cache server is reachable --- .forgejo/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index d1ced9ec..a5ffd3f1 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -37,16 +37,6 @@ jobs: with: fetch-depth: 0 - - name: Debug Actions Cache connectivity - run: | - env | grep -i "ACTIONS_" || echo "no ACTIONS_ env vars found" - if [ -n "$ACTIONS_CACHE_URL" ]; then - echo "Cache URL is set, testing reachability from inside the job container:" - curl -v --max-time 5 "$ACTIONS_CACHE_URL" || echo "UNREACHABLE from job container" - else - echo "ACTIONS_CACHE_URL is empty: the cache server is not enabled in the runner's config.yaml" - fi - - name: Detect docs-relevant changes id: filter run: | @@ -64,6 +54,16 @@ jobs: echo "docs=false" >> "$GITHUB_OUTPUT" fi + - name: Cache Bun & Turbo + uses: actions/cache@v4 + with: + path: | + ~/.bun/install/cache + .turbo + key: bun-${{ hashFiles('bun.lock') }} + restore-keys: | + bun- + - name: Install dependencies run: bun install --frozen-lockfile --ignore-scripts -- 2.54.0 From 0dfeba11659e75c28356e4096e5c095b56b6d02f Mon Sep 17 00:00:00 2001 From: abiwab Date: Wed, 26 Aug 2026 17:55:29 +0200 Subject: [PATCH 10/10] ci: verify bun/turbo cache restore hits on a second run -- 2.54.0