-
Notifications
You must be signed in to change notification settings - Fork 357
391 lines (334 loc) · 11.6 KB
/
test.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
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
name: Test
defaults:
run: {shell: bash}
on:
workflow_call:
workflow_dispatch:
jobs:
format:
name: Code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart format --fix .
- run: git diff --exit-code
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Analyze Dart
run: dart analyze --fatal-warnings ./
dartdoc:
name: Dartdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: dartdoc sass
run: dart run dartdoc --quiet --no-generate-docs
--errors ambiguous-doc-reference,broken-link,deprecated
--errors unknown-directive,unknown-macro,unresolved-doc-reference
- name: dartdoc sass_api
run: cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs
--errors ambiguous-doc-reference,broken-link,deprecated
--errors unknown-directive,unknown-macro,unresolved-doc-reference
sass_spec_language:
name: "Language Tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dart_channel: [stable, dev]
async_label: [synchronous]
async_args: ['']
include:
- dart_channel: stable
async_label: asynchronous
async_args: '--cmd-args --async'
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
- uses: ./.github/util/sass-spec
- name: Run specs
run: npm run sass-spec -- --dart .. $extra_args
working-directory: sass-spec
env: {extra_args: "${{ matrix.async_args }}"}
sass_spec_js:
name: "JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dart_channel: [stable]
node-version: ['lts/*']
include:
# Test older LTS versions
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-1
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-2
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-3
# Test LTS version with dart dev channel
- os: ubuntu-latest
dart_channel: dev
node-version: 'lts/*'
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
node-version: ${{ matrix.node-version }}
- uses: ./.github/util/sass-spec
- name: Build JS
run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
with:
repo: sass/sass
path: language
- name: Run tests
run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm
working-directory: sass-spec
sass_spec_js_embedded:
name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['lts/*']
include:
# Test older LTS versions
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-1
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-2
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-3
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
github-token: ${{ github.token }}
node-version: ${{ matrix.node-version }}
- uses: ./.github/util/sass-spec
- name: Check out the embedded host
uses: sass/clone-linked-repo@v1
with: {repo: sass/embedded-host-node}
- name: Check out the language repo
uses: sass/clone-linked-repo@v1
with: {repo: sass/sass, path: build/language}
- name: Initialize embedded host
run: |
npm install
npm run init -- --compiler-path=.. --language-path=../build/language
npm run compile
mv {`pwd`/,dist/}lib/src/vendor/dart-sass
working-directory: embedded-host-node
- name: Version info
run: |
path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass
if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version
elif [[ -f "$path.bat" ]]; then "./$path.bat" --version
elif [[ -f "$path.exe" ]]; then "./$path.exe" --version
else "./$path" --version
fi
- name: Run tests
run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../build/language
working-directory: sass-spec
sass_spec_js_browser:
name: "JS API Tests | Browser | Dart ${{ matrix.dart_channel }}"
strategy:
matrix:
dart_channel: [stable]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
- uses: ./.github/util/sass-spec
- name: Build JS
run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- name: Install built dependencies
run: npm install
working-directory: build/npm
- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
with:
repo: sass/sass
path: language
- name: Run tests
run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm --browser
working-directory: sass-spec
env:
CHROME_EXECUTABLE: chrome
dart_tests:
name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dart_channel: [stable]
# TODO(nweiz): Re-enable this when
# https://github.com/dart-lang/sdk/issues/52121#issuecomment-1728534228
# is addressed.
# include: [{os: ubuntu-latest, dart_channel: dev}]
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
- run: dart run grinder pkg-standalone-dev
- name: Run tests
run: dart run test -x node
# Unit tests that use Node.js, defined in test/.
node_tests:
name: "Node tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dart_channel: [stable]
node-version: ['lts/*']
include:
# Test older LTS versions
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-1
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-2
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-3
# Test LTS version with dart dev channel
- os: ubuntu-latest
dart_channel: dev
node-version: 'lts/*'
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
node-version: ${{ matrix.node-version }}
- run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- name: Run tests
run: dart run test -t node -j 2
browser_tests:
name: "Browser Tests | Dart ${{ matrix.dart_channel }}"
strategy:
matrix:
dart_channel: [stable]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: browser-actions/setup-chrome@v1
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
- run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- run: sudo chmod 4755 /opt/google/chrome/chrome-sandbox
- name: Run tests
run: dart run test -p chrome -j 2
env:
CHROME_EXECUTABLE: chrome
# See https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md#option-3_the-safest-way
CHROME_DEVEL_SANDBOX: /opt/google/chrome/chrome-sandbox
sass_parser_tests:
name: "sass-parser Tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dart_channel: [stable]
node-version: ['lts/*']
include:
# Test older LTS versions
#
# TODO: Test on lts/-2 and lts/-3 once they support
# `structuredClone()` (that is, once they're v18 or later).
- os: ubuntu-latest
dart_channel: stable
node-version: lts/-1
# Test LTS version with dart dev channel
- os: ubuntu-latest
dart_channel: dev
node-version: 'lts/*'
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with:
dart-sdk: ${{ matrix.dart_channel }}
github-token: ${{ github.token }}
node-version: ${{ matrix.node-version }}
- run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- run: npm install
working-directory: pkg/sass-parser/
- name: Run tests
run: npm test
working-directory: pkg/sass-parser/
sass_parser_static_analysis:
name: "sass-parser Static Analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: {node-version: 'lts/*'}
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- run: dart run grinder pkg-npm-dev
env: {UPDATE_SASS_SASS_REPO: false}
- run: npm install
working-directory: build/npm/
- run: npm install
working-directory: pkg/sass-parser/
- name: Run static analysis
run: npm run check
working-directory: pkg/sass-parser/
# TODO - postcss/postcss#1958: Enable this once PostCSS doesn't have TypeDoc
# warnings.
# sass_parser_typedoc:
# name: "sass-parser Typedoc"
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with: {node-version: 'lts/*'}
# - run: npm install
# working-directory: pkg/sass-parser/
# - run: npm run typedoc
# working-directory: pkg/sass-parser/