Repository navigation
77 lines (70 loc) · 2.51 KB
/
Copy pathtests.yml
File metadata and controls
77 lines (70 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Tests
on:
pull_request:
branches:
- main
- docusaurus-v**
paths:
- package.json
- pnpm-lock.yaml
- vitest.config.ts
- test/**
- packages/**
- tsconfig.*.json
- .github/workflows/tests.yml
- .github/actions/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Tests
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: Test
run: pnpm test
- name: TypeCheck tests
run: pnpm typecheck:tests
- name: Remove Theme Internal Re-export
run: pnpm --filter @docusaurus/theme-common removeThemeInternalReexport
- name: Docusaurus Build
# We build 2 locales to ensure a localized site doesn't leak memory
# See https://github.com/meta/docusaurus/issues/10944
run: pnpm build:website:fast --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=300'
DOCUSAURUS_PERF_LOGGER: 'true'
- name: Docusaurus site CSS order
run: pnpm --filter website test:css-order
- name: TypeCheck website
# see https://github.com/meta/docusaurus/pull/10486
run: pnpm --filter website typecheck
# The TypeScript compiler of the tested version runs with pnpm dlx,
# without modifying the workspace dependencies (package.json, catalogs)
- name: TypeCheck website - min version - v6.0
run: |
pnpm dlx --package=typescript@6.0 tsc --version
pnpm dlx --package=typescript@6.0 tsc --project website/tsconfig.json
- name: TypeCheck website - max version - Latest
# For latest TS there are often lib check errors, so we disable it
# Details: https://github.com/meta/docusaurus/pull/10486
run: |
pnpm dlx --package=typescript@latest tsc --version
pnpm dlx --package=typescript@latest tsc --project website/tsconfig.skipLibCheck.json