utils/.github/workflows/ts-core-tests.yml
Krzysztof kuhy Rudnicki cb64e93b97 ci: install the linked preset's deps before linting ts_core/web_ui; deps green
ts_core and web_ui depend on `link:../ts_config`. pnpm links the directory
and installs nothing inside it, and a flat config imports its plugins from
the preset's own node_modules, so CI died on "Cannot find package
'@eslint/js'" while the local tree (where ts_config had been installed by
hand) passed. Both workflows now `pnpm install` in ts_config first, and
trigger on ts_config/** too so a preset change re-verifies its consumers.

The same push turned the dependency-freshness job red on five pins that had
aged underneath it (ruff 0.16.8 in four requirements.txt,
flutter_secure_storage 11.2.0 in crdt_sync_flutter); bumped, pubspec.lock is
ignored in that package so nothing else moves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnAYyNH1Sm4iJNidfYbrZJ
2026-09-16 21:50:13 +02:00

57 lines
1.6 KiB
YAML

name: ts_core tests
on:
push:
branches: [main]
paths: ['ts_core/**', 'ts_config/**']
pull_request:
branches: [main]
paths: ['ts_core/**', 'ts_config/**']
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ts_core
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 12
- uses: actions/setup-node@v4
with:
node-version: "24.21.0"
# The preset is a `link:../ts_config` dependency. pnpm links the
# directory but installs nothing inside it, and a flat config imports
# its plugins from the preset's own node_modules -- so without this
# step the lint dies on "Cannot find package '@eslint/js'".
- name: Install the shared lint preset's dependencies
run: pnpm install --frozen-lockfile
working-directory: ts_config
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Run tests with the 100% coverage gate
run: pnpm coverage
# The tag ships a prebuilt dist/ because Vite does not transpile
# dependencies. A committed dist/ that does not match src/ would ship
# stale code to every consumer with no error anywhere, so rebuild and
# fail if the result differs from what is checked in.
- name: dist/ is in sync with src/
run: |
pnpm build
if ! git diff --exit-code -- dist; then
echo "::error::dist/ is stale — run 'pnpm build' in ts_core and commit the result."
exit 1
fi