name: Prebuilt UI
permissions:
contents: read
on:
pull_request:
paths:
- 'client/**'
- 'src/build/client.rs'
- 'prebuilt.html'
- 'pnpm-workspace.yaml'
jobs:
freshness:
name: prebuilt-html-fresh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Install pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271
- name: Install Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with:
node-version: 22
cache: pnpm
- name: Install Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 with:
toolchain: stable
- name: Cache cargo registry (registry only, not target)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Rebuild the UI (build.rs regenerates prebuilt.html via pnpm)
run: cargo check
- name: Fail if the committed prebuilt.html is stale
run: |
if ! git diff --exit-code -- prebuilt.html; then
echo ""
echo "prebuilt.html is out of date for the current client/ source."
echo "Rebuild it locally (pnpm install && cargo build) and commit the result."
exit 1
fi