Skip to content

chore: Bump vitest from 5.0.0 to 5.0.1 #1001

chore: Bump vitest from 5.0.0 to 5.0.1

chore: Bump vitest from 5.0.0 to 5.0.1 #1001

Workflow file for this run

name: PR Preview
on:
pull_request:
types: [opened, synchronize, reopened, closed]
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
check:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
# Content validation gate: astro sync runs the Zod collection schema and
# fails on invalid adventure YAML.
- run: npm run sync
- run: npm run lint
- run: npm run check
- run: npm run test:unit:coverage
build:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run sync
- run: npm run build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
retention-days: 1
e2e:
needs: build
if: github.event.action != 'closed'
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
- uses: actions/download-artifact@v7
with:
name: dist
path: dist/
- uses: actions/cache@v6
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
# playwright.config webServer runs a plain Node.js static server (serves dist/).
- run: npm run test:e2e -- --shard=${{ matrix.shard }}/3
preview:
needs: [check, e2e]
if: always() && ((needs.check.result == 'success' && needs.e2e.result == 'success') || needs.check.result == 'skipped')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- if: github.event.action != 'closed'
uses: actions/cache@v6
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: github.event.action != 'closed' && steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
# Astro's `base` (from VITE_BASE_PATH) prefixes every asset/link, and public/
# assets are copied into dist/ automatically — so the whole dist/ deploys as
# the preview with no per-directory asset-copy step. Layout.astro marks
# /pr-preview/ builds noindex.
- if: github.event.action != 'closed'
run: npm run sync
- if: github.event.action != 'closed'
env:
PR_NUMBER: ${{ github.event.number }}
run: VITE_BASE_PATH=/pr-preview/pr-${PR_NUMBER}/ npm run build
- uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1
with:
source-dir: dist/