mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
* chore(deps): bump actions/setup-node from 4.2.0 to 4.3.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](1d0ff469b7...cdca7365b2
)
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* refactor: apply lint autofix
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
228 lines
8 KiB
YAML
228 lines
8 KiB
YAML
name: E2E Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- docusaurus-v**
|
|
paths:
|
|
- package.json
|
|
- yarn.lock
|
|
- jest.config.mjs
|
|
- packages/**
|
|
- tsconfig.*.json
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- docusaurus-v**
|
|
paths:
|
|
- package.json
|
|
- yarn.lock
|
|
- jest.config.mjs
|
|
- packages/**
|
|
- tsconfig.*.json
|
|
- admin/verdaccio.yaml
|
|
- .github/workflows/tests-e2e.yml
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
yarn-v1:
|
|
name: E2E — Yarn v1
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: ['18.0', '20', '22']
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn || yarn || yarn
|
|
- name: Generate test-website project against main branch
|
|
run: yarn test:build:website -s
|
|
- name: Install test-website project with Yarn v1
|
|
run: yarn || yarn || yarn
|
|
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/facebook/docusaurus/pull/10599
|
|
run: yarn build --locale en --locale fr
|
|
env:
|
|
# Our website should build even with limited memory
|
|
# See https://github.com/facebook/docusaurus/pull/10590
|
|
NODE_OPTIONS: '--max-old-space-size=300'
|
|
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Use Node.js LTS
|
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
|
|
with:
|
|
node-version: lts/*
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn || yarn || yarn
|
|
- name: Generate test-website project with ${{ matrix.variant }} against main branch
|
|
run: yarn test:build:website ${{ matrix.variant }}
|
|
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
|
|
run: |
|
|
yarn set version berry
|
|
|
|
yarn config set nodeLinker ${{ matrix.nodeLinker }}
|
|
yarn config set npmRegistryServer http://localhost:4873
|
|
yarn config set unsafeHttpWhitelist --json '["localhost"]'
|
|
yarn config set enableGlobalCache true
|
|
|
|
# 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 - v5.1
|
|
# 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@5.1.6 --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/facebook/docusaurus/pull/10599
|
|
run: yarn build --locale en --locale fr
|
|
env:
|
|
# Our website should build even with limited memory
|
|
# See https://github.com/facebook/docusaurus/pull/10590
|
|
NODE_OPTIONS: '--max-old-space-size=300'
|
|
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Use Node.js LTS
|
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
|
|
with:
|
|
node-version: lts/*
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn || yarn || yarn
|
|
- name: Generate test-website project against main branch
|
|
run: yarn 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: yarn 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/facebook/docusaurus/pull/10599
|
|
run: npm run build -- --locale en --locale fr
|
|
env:
|
|
# Our website should build even with limited memory
|
|
# See https://github.com/facebook/docusaurus/pull/10590
|
|
NODE_OPTIONS: '--max-old-space-size=300'
|
|
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: Use Node.js LTS
|
|
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
|
|
with:
|
|
node-version: lts/*
|
|
cache: yarn
|
|
- name: Installation
|
|
run: yarn || yarn || yarn
|
|
- name: Generate test-website project against main branch
|
|
run: yarn test:build:website -st
|
|
- name: Install test-website project with pnpm
|
|
run: |
|
|
npm install -g pnpm
|
|
pnpm install
|
|
working-directory: ../test-website
|
|
env:
|
|
npm_config_registry: http://localhost:4873
|
|
- name: TypeCheck website
|
|
working-directory: ../test-website
|
|
run: yarn 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/facebook/docusaurus/pull/10599
|
|
run: pnpm run build --locale en --locale fr
|
|
env:
|
|
# Our website should build even with limited memory
|
|
# See https://github.com/facebook/docusaurus/pull/10590
|
|
NODE_OPTIONS: '--max-old-space-size=300'
|
|
DOCUSAURUS_PERF_LOGGER: 'true'
|
|
working-directory: ../test-website
|