-
-
Notifications
You must be signed in to change notification settings - Fork 67
69 lines (60 loc) · 2.72 KB
/
main.yml
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
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
# Prevent duplicates runs for PRs from non-forks.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
defaults:
run:
# TODO: Our package.json scripts currently assume that they are run
# from bash, even on Windows.
# We should probably make them OS-agnostic instead.
shell: bash
continue-on-error: ${{ matrix.docusaurus-version == 'canary' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18.x, 20.x, 22.x]
docusaurus-version:
- "v2.4.3"
- "v2.4.1"
- "v2.4.0"
- "v2.3.1"
- "v2.2.0"
- "v2.1.0"
- "v2.0.1"
- "canary"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- run: pnpm install
- run: pnpm run lint
- run: pnpm -r add --save-dev '@docusaurus/core@${{ matrix.docusaurus-version }}' '@docusaurus/preset-classic@${{ matrix.docusaurus-version }}' '@docusaurus/module-type-aliases@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-blog@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-docs@${{ matrix.docusaurus-version }}' '@docusaurus/plugin-content-pages@${{ matrix.docusaurus-version }}' '@docusaurus/theme-common@${{ matrix.docusaurus-version }}' '@docusaurus/theme-classic@${{ matrix.docusaurus-version }}' '@docusaurus/types@${{ matrix.docusaurus-version }}'
- run: pnpm dedupe
- run: pnpm run build
- run: pnpm run test
# Install OS dependencies
# Run `apt update` beforehand to avoid 404 Not Found errors during apt install.
- run: sudo apt update
if: runner.os == 'Linux'
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install-deps
# Install Browsers
- run: pnpm --filter docusaurus-search-local --fail-if-no-match exec playwright install
- run: pnpm run test:e2e -- -- --browser=all --forbid-only
# TODO: Cannot run browser tests for these for now.
- run: pnpm run build -w example-docs -- --config docusaurus.config.noTrailingSlash.js
- run: pnpm run build -w example-docs -- --config docusaurus.config.subDirectory.js
- run: pnpm run build -w example-docs -- --config docusaurus.config.noTrailingSlashSubdirectory.js