Skip to content

fix(utils): preserve trailing hash in content title unless preceded by space (#12644) #10189

fix(utils): preserve trailing hash in content title unless preceded by space (#12644)

fix(utils): preserve trailing hash in content title unless preceded by space (#12644) #10189

Workflow file for this run

name: E2E Tests
on:
push:
branches:
- main
- docusaurus-v**
paths:
- package.json
- pnpm-lock.yaml
- vitest.config.ts
- test/**
- packages/**
- tsconfig.*.json
pull_request:
branches:
- main
- docusaurus-v**
paths:
- package.json
- pnpm-lock.yaml
- vitest.config.ts
- test/**
- packages/**
- tsconfig.*.json
- admin/verdaccio.yaml
- admin/scripts/test-release.sh
- .github/workflows/tests-e2e.yml
- .github/actions/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# e2e tests running on Windows
e2e-windows:
name: E2E — Windows
timeout-minutes: 30
runs-on: windows-8-core
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# No pnpm cache on Windows on purpose: restoring it takes 20-80s,
# more than it saves on "pnpm install"
- name: Set up pnpm, Node.js and dependencies
uses: $/.github/actions/setup
- name: Generate test-website project against main branch
# Not using test-release.sh => no verdaccio docker image on Windows
# We have to generate the test website in workspace so that it uses
# current packages as dependencies instead of deps from npm
run: node ./packages/create-docusaurus/bin/index.js test-website-in-workspace classic --typescript
- name: Install test-website-in-workspace project
run: pnpm install --no-frozen-lockfile --ignore-scripts || pnpm install --no-frozen-lockfile --ignore-scripts || pnpm install --no-frozen-lockfile --ignore-scripts
working-directory: test-website-in-workspace
- name: Start test-website-in-workspace project
run: pnpm start --no-open
working-directory: test-website-in-workspace
env:
E2E_TEST: true
- name: Build test-website-in-workspace project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: pnpm build --locale en --locale fr
env:
# Our website should build even with limited memory
# See https://github.com/meta/docusaurus/pull/10590
NODE_OPTIONS: '--max-old-space-size=200'
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: test-website-in-workspace
# Upload build artifacts to ease Windows-specific troubleshooting
- name: Upload website artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: website-e2e-windows
path: test-website-in-workspace/build
if-no-files-found: error
- name: TypeCheck website
working-directory: test-website-in-workspace
run: pnpm typecheck
yarn-v1:
name: E2E — Yarn v1
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node: ['26.13', '26']
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm, Node.js ${{ matrix.node }} and dependencies
uses: $/.github/actions/setup
with:
node-version: ${{ matrix.node }}
cache: true
- name: Generate test-website project against main branch
run: pnpm test:build:website -s
- name: Install test-website project with Yarn v1
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: yarn start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: yarn build --locale en --locale fr
env:
# Our website should build even with limited memory
# See https://github.com/meta/docusaurus/pull/10590
NODE_OPTIONS: '--max-old-space-size=200'
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: ../test-website
yarn-berry:
name: E2E — Yarn Berry
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
nodeLinker: [pnp, node-modules]
variant: [-s, -st]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm, Node.js and dependencies
uses: $/.github/actions/setup
with:
cache: true
- name: Generate test-website project with ${{ matrix.variant }} against main branch
run: pnpm test:build:website ${{ matrix.variant }}
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
run: |
yarn set version berry
# Disable supply chain cooldown
# We don't need it in that workflow
# Our other workflows already have cooldown checks!
yarn config set npmMinimalAgeGate 0
yarn config get npmMinimalAgeGate --why
yarn config set npmMinimalAgeGate 0
yarn config set nodeLinker ${{ matrix.nodeLinker }}
yarn config set npmRegistryServer http://localhost:4873
yarn config set unsafeHttpWhitelist --json '["localhost"]'
yarn config set enableGlobalCache true
yarn config set npmPreapprovedPackages --json '["@docusaurus/*"]'
# Make PnP as strict as possible
# https://yarnpkg.com/features/pnp#fallback-mode
yarn config set pnpFallbackMode none
yarn || yarn || yarn
working-directory: ../test-website
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false # Yarn berry should create the lockfile, despite CI env
- name: Start test-website project
run: yarn start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: TypeCheck website
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
working-directory: ../test-website
run: yarn typecheck
- name: TypeCheck website - min version - v6.0
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
working-directory: ../test-website
run: |
yarn add typescript@6.0 --exact
yarn typecheck
- name: TypeCheck website - max version - Latest
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
working-directory: ../test-website
run: |
yarn add typescript@latest --exact
yarn typecheck
- name: Build test-website project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: yarn build --locale en --locale fr
env:
# Our website should build even with limited memory
# See https://github.com/meta/docusaurus/pull/10590
NODE_OPTIONS: '--max-old-space-size=200'
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: ../test-website
npm:
name: E2E — npm
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm, Node.js and dependencies
uses: $/.github/actions/setup
with:
cache: true
- name: Generate test-website project against main branch
run: pnpm test:build:website -st
- name: Install test-website project with npm
run: npm install
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: TypeCheck website
working-directory: ../test-website
run: npm run typecheck
- name: Start test-website project
run: npm run start -- --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: npm run build -- --locale en --locale fr
env:
# Our website should build even with limited memory
# See https://github.com/meta/docusaurus/pull/10590
NODE_OPTIONS: '--max-old-space-size=200'
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: ../test-website
pnpm:
name: E2E — pnpm
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm, Node.js and dependencies
uses: $/.github/actions/setup
with:
cache: true
- name: Generate test-website project against main branch
run: pnpm test:build:website -st
- name: Install test-website project with pnpm
run: pnpm install
working-directory: ../test-website
env:
pnpm_config_registry: http://localhost:4873
- name: TypeCheck website
working-directory: ../test-website
run: pnpm run typecheck
- name: Start test-website project
run: pnpm start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: pnpm run build --locale en --locale fr
env:
# Our website should build even with limited memory
# See https://github.com/meta/docusaurus/pull/10590
NODE_OPTIONS: '--max-old-space-size=200'
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: ../test-website
bun:
name: E2E — Bun ${{ matrix.bun }}
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Older versions hang or leak memory when building
# See https://github.com/meta/docusaurus/pull/13044
bun: ['1.4.3', 'latest']
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm, Node.js and dependencies
uses: $/.github/actions/setup
with:
cache: true
- name: Set up Bun ${{ matrix.bun }}
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: ${{ matrix.bun }}
- name: Generate test-website project against main branch
run: pnpm test:build:website -st
- name: Install test-website project with Bun
run: bun install
working-directory: ../test-website
env:
BUN_CONFIG_REGISTRY: http://localhost:4873
- name: TypeCheck website
working-directory: ../test-website
run: bun run typecheck
# --bun runs the Docusaurus CLI with the Bun runtime instead of Node.js
- name: Start test-website project
run: bun --bun run start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
# Bun ignores --max-old-space-size: we limit the whole process memory
# See https://github.com/meta/docusaurus/pull/13044
run: systemd-run --user --scope --quiet -p MemoryMax=550M -p MemorySwapMax=0 bun --bun run build --locale en --locale fr
env:
DOCUSAURUS_PERF_LOGGER: 'true'
working-directory: ../test-website