-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
195 lines (184 loc) · 6.23 KB
/
tests-e2e.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
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.4']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Installation
run: 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 install
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
run: yarn build
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: yarn
- name: Installation
run: 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 install
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 [email protected] --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
run: yarn build
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: yarn
- name: Installation
run: yarn
- name: Generate test-website project against main branch
run: yarn test:build:website -s
- name: Install test-website project with npm
run: npm install
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: npm run start -- --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: npm run build
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: lts/*
cache: yarn
- name: Installation
run: yarn
- name: Generate test-website project against main branch
run: yarn test:build:website -s
- name: Install test-website project with pnpm
run: |
npm install -g pnpm
# Fix some peer dependencies errors
pnpm add @algolia/client-search @types/react@17 typescript
working-directory: ../test-website
env:
npm_config_registry: http://localhost:4873
- name: Start test-website project
run: pnpm start --no-open
working-directory: ../test-website
env:
E2E_TEST: true
- name: Build test-website project
run: pnpm run build
working-directory: ../test-website