Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
permissions:
contents: read

# A force-push to a PR branch previously left the superseded run executing to
# completion alongside the new one. Cancel superseded runs on PR refs; keep
# main pushes uncancelled so every landed commit gets a full verdict.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check:
name: Full gate (${{ matrix.os }}, Node ${{ matrix.node-version }})
Expand Down Expand Up @@ -48,9 +55,30 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# Package-download cache: bun still verifies against the frozen lockfile,
# it just skips re-downloading unchanged tarballs.
- name: Cache bun downloads
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-

- name: Install dependencies
run: bun install --frozen-lockfile

# vitest-native's own on-disk caches (the Babel transform of the RN graph +
# the V8 compile cache) live under node_modules/.cache/vitest-native and are
# content/version-keyed internally, so restoring a stale snapshot is safe —
# outdated entries simply miss. Restored after install (bun may reshape
# node_modules), saved automatically post-job.
- name: Cache vitest-native transform output
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: packages/vitest-native/node_modules/.cache/vitest-native
key: vn-transform-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('bun.lock') }}
restore-keys: vn-transform-${{ runner.os }}-node${{ matrix.node-version }}-

- name: Verify dependencies are pinned
run: bun run lint:deps

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/native-rn-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ on:
permissions:
contents: read

# Cancel superseded runs on PR refs (a force-push previously left 10+ stale
# cells running to completion); keep main/scheduled runs uncancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
matrix:
name: native+hot — vitest ${{ matrix.vitest }} × RN ${{ matrix.rn }}
runs-on: ubuntu-latest
# Without a bound, a hung cell (e.g. a stuck hot-soak worker) burns the
# 360-minute default. A healthy cell finishes well under 15 minutes.
timeout-minutes: 30
strategy:
# Report every cell independently rather than stopping at the first failure.
fail-fast: false
Expand All @@ -58,6 +67,15 @@ jobs:
with:
node-version: '22.13.0'

# Package-download cache: bun still verifies against the frozen lockfile,
# it just skips re-downloading unchanged tarballs.
- name: Cache bun downloads
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-

- name: Install dependencies
run: bun install --frozen-lockfile

Expand All @@ -67,6 +85,18 @@ jobs:
run: |
bun add -d "react-native@${{ matrix.rn }}" "@react-native/babel-preset@${{ matrix.rn }}" --cwd packages/vitest-native

# vitest-native's on-disk caches (Babel transform of the RN graph + V8
# compile cache), keyed per matrix cell — each cell transforms a different
# RN version. Entries are content/version-keyed internally, so a stale
# restore is a miss, never a wrong hit. Restored after the version pins
# (bun add reshapes node_modules), saved automatically post-job.
- name: Cache vitest-native transform output
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: packages/vitest-native/node_modules/.cache/vitest-native
key: vn-transform-${{ runner.os }}-rn${{ matrix.rn }}-vitest-${{ matrix.vitest }}-${{ hashFiles('bun.lock') }}
restore-keys: vn-transform-${{ runner.os }}-rn${{ matrix.rn }}-vitest-${{ matrix.vitest }}-

- name: Pin Vitest to the newest supported 4.x release
if: matrix.vitest == 'latest-supported'
# Bump the coverage provider in lockstep — a mismatched @vitest/coverage-v8
Expand Down
Loading