-
-
Notifications
You must be signed in to change notification settings - Fork 344
60 lines (51 loc) · 1.78 KB
/
test-pnp.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
name: test-pnp
on:
pull_request:
push:
branches: main
jobs:
pnp-install-and-run:
if: ${{ !contains(github.event.head_commit.message, '[release]') }}
runs-on: ubuntu-latest
steps:
- run: git config --global core.autocrlf false
- name: Clone react-cosmos monorepo
uses: actions/checkout@v4
with:
path: react-cosmos
- name: Clone PnP example repo
uses: actions/checkout@v4
with:
repository: react-cosmos/pnp-example
path: pnp-example
# https://github.com/actions/setup-node/issues/531#issuecomment-1872977503
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: actions/cache@v4
id: npm-cache
with:
path: .npm-cache
key: '${{ runner.os }}-npm'
- name: Build react-cosmos packages
run: |
cd react-cosmos
npm ci --cache .npm-cache
npm run build
- name: Run PnP example with linked react-cosmos packages
run: |
cd pnp-example
yarn set version stable
yarn link ../react-cosmos/packages/react-cosmos-core
yarn link ../react-cosmos/packages/react-cosmos-renderer
yarn link ../react-cosmos/packages/react-cosmos-dom
yarn link ../react-cosmos/packages/react-cosmos-ui
yarn link ../react-cosmos/packages/react-cosmos
yarn link ../react-cosmos/packages/react-cosmos-plugin-webpack
yarn install --immutable --network-timeout 600000
yarn cosmos &
- name: Wait until Cosmos is live
run: npx wait-on -t 10000 http://localhost:5000
- name: Wait until Cosmos renderer is live
run: npx wait-on -t 10000 http://localhost:5000/renderer.html