Simpl-Resultat/.forgejo/workflows/check-frontend.yml
le king fu c859405deb
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m4s
fix(release): refuse an empty or multi-document latest.json, test the Publish step
Follow-ups of the review of PR #418.

- check-latest-json.jq wants exactly one document and release.yml calls it
  with -s: under jq 1.6, the release container's, an empty file passed the
  check (no output, status 0) and two documents were judged on the last one,
  so the job would have deleted the published manifest and uploaded the bad
  one. Two tests cover both cases.
- build-latest-json.test.mjs runs the text of release.yml's "Publish
  latest.json to package registry" step against a fake curl: DELETE then PUT
  on a valid manifest, exit 1 and no request on a refused one.
- check-frontend no longer ignores .claude/** and release.yml (decision of
  Max): the test reads verify-release.sh and runs the Publish step, so "on
  every pull request" holds. REVIEW.md, CLAUDE.md and architecture.md follow.
- release.yml: stale ".deb fallback" comment fixed.
- qa-update-cycle.md: a tauri dev build on Linux shows TargetsNotFound,
  expected since #418.

Refs #461

Resolves #419

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:00:40 -04:00

74 lines
2.4 KiB
YAML

name: PR Check — Frontend
# Frontend half of the former check.yml (split in #232).
#
# Filtered with paths-ignore rather than an allowlist: this job costs ~2.5 min,
# so running it when it was not strictly needed is cheap, while silently NOT
# running it is not. A root-level config file added later would drop out of an
# allowlist without anyone noticing; here it fails safe.
#
# .claude/** and release.yml are not ignored (#419): scripts/build-latest-json.test.mjs
# reads .claude/skills/release/scripts/verify-release.sh and runs the text of
# release.yml's "Publish latest.json to package registry" step, so a PR that
# touches only one of them must still run it.
#
# No `branches:` filter — see check-rust.yml.
on:
pull_request:
paths-ignore:
- 'src-tauri/**'
- '.cargo/**'
- 'docs/**'
- 'reports/**'
- 'tasks/**'
- '.github/**'
- '.forgejo/workflows/check-rust.yml'
- '.forgejo/workflows/audit.yml'
- '*.md'
- 'LICENSE'
# Same concurrency setup as check-rust.yml (own group, cancel-in-progress),
# whose comment says what it does on Forgejo 8.0.3 (#376) and why each
# workflow has its own group.
concurrency:
group: ci-frontend-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
frontend:
runs-on: ubuntu
container: ubuntu:22.04
steps:
- name: Install Node.js 24
run: |
apt-get update
# jq: scripts/build-latest-json.test.mjs runs the script that writes
# the release's latest.json, and that script needs it (#320).
apt-get install -y --no-install-recommends curl ca-certificates git jq
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
apt-get install -y nodejs
node --version
npm --version
jq --version
- name: Checkout
uses: https://github.com/actions/checkout@v4
# No npm cache step, by decision (#234). The runner's cache works since
# 2026-10-03, but it keeps what a pull_request run saves private to that
# PR, and this workflow runs on PRs only: a cache would serve later
# pushes to the same PR, while `npm ci` takes 9s here (run 456) and
# each PR's first run would pay for the save.
- name: Install dependencies
run: npm ci
- name: Build (tsc + vite)
run: npm run build
- name: Tests (vitest)
run: npm test