12# CI for src.rest: the complete gate (scripts/verify-demo-build.sh), the website3# gate (scripts/verify-website.sh) and the Decky plugin gate, as ci.yml runs them.4set -eu5cache=${XDG_CACHE_HOME:-$HOME/.cache}/goq6mkdir -p "$cache/target"7# Cargo's output lives outside the worktree so runs don't rebuild every crate.8# target/ links to it because scripts/tests read target/debug/sigil directly.9export CARGO_TARGET_DIR="$cache/target"10ln -s "$CARGO_TARGET_DIR" target11# forge resets its CI worktree with git clean, which deletes the portal-dist/12# that src-tauri/build.rs writes but keeps tracked mtimes, so cargo would13# think that build script fresh. Touching its input makes it run again.14touch portal/runtime-files.txt15./scripts/verify-demo-build.sh16./scripts/verify-website.sh1718# package-decky-plugin.py insists on pnpm 9.4.0, decky/package.json's pin.19if [ ! -x "$cache/pnpm-9.4.0/node_modules/.bin/pnpm" ]; then20 npm install --prefix "$cache/pnpm-9.4.0" --no-audit --no-fund pnpm@9.4.021fi22PATH="$cache/pnpm-9.4.0/node_modules/.bin:$PATH"23(cd decky && pnpm install --frozen-lockfile && pnpm test && pnpm typecheck && pnpm build)24artifacts=$(mktemp -d)25trap 'rm -rf "$artifacts"' EXIT26python3 scripts/package-decky-plugin.py "$artifacts/decky"27python3 -m unittest scripts.tests.test_decky_package -v