-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
211 lines (177 loc) · 5.89 KB
/
build.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Automate, customize, and execute your software development workflows right in your repository with GitHub Actions.
# Documentation: https://docs.github.com/en/actions
name: build
env:
PNPM_VERSION: 9.15.2
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
- develop
- next
- release/*
tags:
- '*'
pull_request:
branches:
- main
- develop
- next
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Load turbo cache
uses: actions/[email protected]
id: turbo-cache
with:
path: |
.turbo
**/.eslintcache
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.sha }}
${{ runner.os }}-turbo-
- name: Install dependencies
id: install-dependencies
run: pnpm install
- name: Lint code
run: pnpm run lint
- name: Try to build the packages
id: build-packages
run: pnpm run build
test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
node-version: [20]
test-spec:
- { name: 'Integration', spec: './tests/cypress/integration/**/*.spec.{js,ts}' }
- { name: 'Demos/Commands', spec: './demos/src/Commands/**/*.spec.{js,ts}' }
- { name: 'Demos/Examples', spec: './demos/src/Examples/**/*.spec.{js,ts}' }
- { name: 'Demos/Experiments', spec: './demos/src/Experiments/**/*.spec.{js,ts}' }
- { name: 'Demos/Extensions', spec: './demos/src/Extensions/**/*.spec.{js,ts}' }
- { name: 'Demos/GuideContent', spec: './demos/src/GuideContent/**/*.spec.{js,ts}' }
- { name: 'Demos/GuideGettingStarted', spec: './demos/src/GuideGettingStarted/**/*.spec.{js,ts}' }
#- { name: "Demos/GuideNodeViews", "./demos/src/GuideNodeViews/**/*.spec.{js,ts}" }
- { name: 'Demos/Marks', spec: './demos/src/Marks/**/*.spec.{js,ts}' }
- { name: 'Demos/Nodes', spec: './demos/src/Nodes/**/*.spec.{js,ts}' }
#- { name: "Demos/Overview", spec: "./demos/src/Overview/**/*.spec.{js,ts}" }
steps:
- uses: actions/[email protected]
- name: Load turbo cache
uses: actions/[email protected]
id: turbo-cache
with:
path: |
.turbo
**/.eslintcache
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.sha }}
${{ runner.os }}-turbo-
- name: Load build cache
uses: actions/[email protected]
id: cache
with:
path: |
./demos/node_modules/.vite
/home/runner/.cache/Cypress
key: ${{ runner.os }}-build-${{ matrix.test-spec.name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.test-spec.name }}-${{ github.sha }}
${{ runner.os }}-build-${{ matrix.test-spec.name }}-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
id: install-dependencies
run: pnpm install && pnpm exec cypress install
- name: Try to build the packages
id: build-packages
run: pnpm run build
- name: Test ${{ matrix.test-spec.name }}
id: cypress
uses: cypress-io/[email protected]
with:
cache-key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
start: pnpm run serve
wait-on: 'http://localhost:3000'
spec: ${{ matrix.test-spec.spec }}
project: ./tests
browser: chrome
quiet: true
- name: Export screenshots (on failure only)
uses: actions/[email protected]
if: failure()
with:
name: cypress-screenshots
path: tests/cypress/screenshots
retention-days: 7
- name: Export screen recordings (on failure only)
uses: actions/[email protected]
if: failure()
with:
name: cypress-videos
path: tests/cypress/videos
retention-days: 7
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
needs: test
steps:
- uses: actions/[email protected]
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Load turbo cache
uses: actions/[email protected]
id: turbo-cache
with:
path: |
.turbo
**/.eslintcache
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.sha }}
${{ runner.os }}-turbo-
- name: Install dependencies
id: install-dependencies
run: pnpm install
- name: Try to build the packages
id: build-packages
run: pnpm run build
- name: Soft release
id: soft-release
run: pnpm exec pkg-pr-new publish './packages/*' --compact