Skip to content

Merge pull request #3858 from pmndrs/fix/3849-usetexture-loop #2884

Merge pull request #3858 from pmndrs/fix/3849-usetexture-loop

Merge pull request #3858 from pmndrs/fix/3849-usetexture-loop #2884

Workflow file for this run

name: Test
on:
push:
# Both active release lines. `v10` matters as much as `master`: PR checks verify a PR's *head*,
# not the result of merging it, and a PR head can lag behind the branch it points at -- so a
# merge can land content no run ever saw. Verifying the branch after the merge catches that.
branches:
- 'master'
- 'v10'
pull_request: {}
jobs:
build:
name: Build, lint, and test (React ${{ matrix.react-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
react-version:
- 19.0.0
- latest
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Use Node 22
uses: actions/setup-node@v5
with:
node-version: 22
cache: 'pnpm'
- name: Set React version (${{ matrix.react-version }})
run: |
npm pkg set devDependencies.react=${{ matrix.react-version }}
npm pkg set devDependencies.react-dom=${{ matrix.react-version }}
- name: Install deps
run: pnpm install --no-frozen-lockfile
- name: Build
run: pnpm run build
# Keep CI in lockstep with the local `pnpm run ci` gate (see docs/development/TESTING.md
# β†’ Local ↔ CI parity). These run locally but were previously CI-only gaps.
- name: Verify bundles
run: pnpm run verify-bundles
- name: Verify types
run: pnpm run verify-types
- name: Check types
run: pnpm run typecheck
- name: Check lint
run: pnpm run eslint
- name: Test (with coverage)
run: pnpm run dev && pnpm run test
- name: Upload coverage report
if: ${{ matrix.react-version == 'latest' }}
uses: actions/upload-artifact@v5
with:
name: coverage
path: coverage/
if-no-files-found: warn
retention-days: 14
- name: Report Fiber size
run: pnpm run analyze-fiber
- name: Report Test Renderer size
run: pnpm run analyze-test
- name: Check formatting
run: pnpm run format
docs-links:
name: Docs link check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v5
# Enforce the readme-stub contract: every readme that sits next to source is a
# thin pointer to the canonical docs, never a second copy of them (the "drift
# rule"). Docs that drift are worse than no docs -- they get believed.
- name: Assert source readmes stay thin pointers
run: |
fail=0
while IFS= read -r f; do
if ! grep -q "Full documentation:" "$f"; then
echo "::error file=$f::source readme must carry a 'Full documentation:' pointer to docs/ or docs.pmnd.rs"
fail=1
fi
lines=$(wc -l < "$f")
if [ "$lines" -gt 25 ]; then
echo "::error file=$f::source readme exceeds the 25-line stub budget ($lines lines) β€” move the content into docs/ and link to it"
fail=1
fi
done < <(find packages/*/src -iname 'readme.md')
exit $fail
# Check external links in docs + readmes. Only http(s) links are in scope:
# the docs renderer resolves site routes itself, in two flavours that both
# look broken on disk -- root-relative ('/frame-loop', '/api/canvas') and
# extension-less relative ('./tsl-hooks'). `--scheme` alone does not skip
# them, because lychee turns local links into `file://` URIs and root-relative
# ones fail at parse time before any exclude applies. So:
# --root-dir lets root-relative links parse (resolved under docs/)
# --exclude ^file:// then drops every local link, however it was written
# Relative *file* links (../webgpu/overview.mdx) are covered by the repo's
# own check, not here. The production docs host is excluded because those
# pages are validated after deploy. 403/429 are accepted because codesandbox,
# npmjs and friends bot-block HEAD requests -- treating those as rot makes
# the job flake, and no real breakage we have hit reported 403 (they were
# 404 and 400, both still caught). The opencollective badge SVGs are
# generated on demand and 500 under load -- the page links they wrap are
# still checked.
#
# Timeouts count as failures, so a live-but-slow third-party host reds out
# every unrelated PR that happens to touch docs. `fail: true` is still what
# we want for real rot, so instead of accepting timeouts we give a slow host
# room to answer: lychee's 20s default is tight for asset sites that render
# a preview per request. Retries cover the single-packet-loss case.
- name: Link check
uses: lycheeverse/lychee-action@v2
with:
args: >-
--no-progress
--scheme http
--scheme https
--root-dir "$GITHUB_WORKSPACE/docs"
--exclude '^file://'
--exclude 'docs\.pmnd\.rs'
--exclude 'opencollective\.com/.*\.svg'
--accept '200,206,403,429'
--timeout 30
--max-retries 3
'docs/**/*.md'
'docs/**/*.mdx'
'packages/*/src/**/[Rr][Ee][Aa][Dd][Mm][Ee].md'
fail: true