-
Notifications
You must be signed in to change notification settings - Fork 1.1k
238 lines (186 loc) · 5.77 KB
/
Copy pathmodule.yml
File metadata and controls
238 lines (186 loc) · 5.77 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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: module
on:
push:
branches:
- v4
pull_request:
branches:
- v4
concurrency:
# Group pull request runs per number so a new push cancels the previous one, and give every push on v4
# its own group since each of them also covers windows and publishes its own preview package
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: read
strategy:
matrix:
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "windows-latest"]') }} # macos-latest
node: [24]
env:
NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v6
- name: Install node
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Prepare
run: pnpm run dev:prepare
- parallel:
- name: Lint
run: pnpm run lint
- name: Typecheck
run: pnpm run typecheck
- name: Test
run: pnpm run test run
- name: Build
run: pnpm run build
- parallel:
- name: Build Nuxt playground
run: pnpm run dev:build
- name: Build Vue playground
run: pnpm run dev:vue:build
- name: Publish
# Only publish preview package on ubuntu, and skip forks of the repo (pkg-pr-new still runs on fork PRs against nuxt/ui)
if: matrix.os == 'ubuntu-latest' && github.repository_owner == 'nuxt'
run: pnpx pkg-pr-new publish --compact --no-template --pnpm
playground:
needs: build
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./playgrounds/nuxt
permissions:
contents: read
pull-requests: read
env:
pnpm_config_strict_dep_builds: false
pnpm_config_verify_deps_before_run: false
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [24]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Store commit SHA
run: |
echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV
- name: Install pnpm
uses: pnpm/action-setup@v6
- name: Install node
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install latest nuxt/ui
run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only
- name: Install dependencies
run: pnpm install --ignore-workspace
- name: Prepare
run: pnpm nuxt prepare
- name: Typecheck
run: pnpm run typecheck
templates:
needs: build
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: read
strategy:
# Keep validating every template when one of them breaks
fail-fast: false
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [24]
template:
- starter
- starter-vue
- landing
- docs
- saas
- dashboard
- dashboard-vue
- chat
- chat-vue
- portfolio
- changelog
- editor
- calendar
include:
# Build with vite directly since the `build` script also runs the database migrations
- template: chat-vue
build: pnpm vite build
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
repository: nuxt-ui-templates/${{ matrix.template }}
- name: Store commit SHA
run: |
echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV
- name: Install pnpm
uses: pnpm/action-setup@v6
- name: Install node
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install latest nuxt/ui
run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only
- name: Install dependencies
run: pnpm install
- name: Build
run: ${{ matrix.build || 'pnpm run build' }}
- name: Typecheck
run: pnpm run typecheck
benchmarks:
# Skip forks of the repo, they can't authenticate with CodSpeed
if: github.repository_owner == 'nuxt'
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write # for OpenID Connect authentication with CodSpeed
env:
NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }}
strategy:
matrix:
os: [ubuntu-latest]
node: [24]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v6
- name: Install node
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Prepare
run: pnpm run dev:prepare
- name: Run benchmarks
uses: CodSpeedHQ/action@v5
with:
mode: simulation
run: pnpm run bench