16
16
pull_request :
17
17
18
18
jobs :
19
+ format :
20
+ name : Code formatting
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - uses : actions/checkout@v3
25
+ - uses : dart-lang/setup-dart@v1
26
+ - run : dart format --fix .
27
+ - run : git diff --exit-code
28
+
29
+ static_analysis :
30
+ name : Static analysis
31
+ runs-on : ubuntu-latest
32
+
33
+ steps :
34
+ - uses : actions/checkout@v3
35
+ - uses : dart-lang/setup-dart@v1
36
+ - run : dart pub get
37
+
38
+ - uses : ./.github/util/build-protobuf
39
+ with : {github-token: "${{ github.token }}"}
40
+
41
+ - name : Analyze Dart
42
+ run : dart analyze --fatal-warnings ./
43
+
44
+ dartdoc :
45
+ name : Dartdoc
46
+ runs-on : ubuntu-latest
47
+
48
+ steps :
49
+ - uses : actions/checkout@v3
50
+ - uses : dart-lang/setup-dart@v1
51
+ - run : dart pub get
52
+ - name : dartdoc sass
53
+ run : dart run dartdoc --quiet --no-generate-docs
54
+ --errors ambiguous-doc-reference,broken-link,deprecated
55
+ --errors unknown-directive,unknown-macro,unresolved-doc-reference
56
+ - name : dartdoc sass_api
57
+ run : cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs
58
+ --errors ambiguous-doc-reference,broken-link,deprecated
59
+ --errors unknown-directive,unknown-macro,unresolved-doc-reference
60
+
19
61
sass_spec_language :
20
62
name : " Language Tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}"
21
63
runs-on : ubuntu-latest
43
85
with : {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
44
86
- run : npm install
45
87
working-directory : sass-spec
88
+
89
+ - uses : ./.github/util/build-protobuf
90
+ with : {github-token: "${{ github.token }}"}
91
+
46
92
- name : Run specs
47
93
run : npm run sass-spec -- --dart .. $extra_args
48
94
working-directory : sass-spec
52
98
# They next need to be rotated April 2021. See
53
99
# https://github.com/nodejs/Release.
54
100
sass_spec_js :
55
- name : " JS API Tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
101
+ name : " JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
56
102
runs-on : " ${{ matrix.os }}"
57
103
58
104
strategy :
82
128
with : {node-version: "${{ matrix.node_version }}"}
83
129
- run : npm install
84
130
131
+ - uses : ./.github/util/build-protobuf
132
+ with : {github-token: "${{ github.token }}"}
133
+
85
134
- name : Check out sass-spec
86
135
uses : sass/clone-linked-repo@v1
87
136
with : {repo: sass/sass-spec}
@@ -103,6 +152,72 @@ jobs:
103
152
run : npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm
104
153
working-directory : sass-spec
105
154
155
+ # The versions should be kept up-to-date with the latest LTS Node releases.
156
+ # They next need to be rotated October 2021. See
157
+ # https://github.com/nodejs/Release.
158
+ sass_spec_js_embedded :
159
+ name : ' JS API Tests | Embedded | Node ${{ matrix.node_version }} | ${{ matrix.os }}'
160
+ runs-on : ${{ matrix.os }}-latest
161
+
162
+ strategy :
163
+ fail-fast : false
164
+ matrix :
165
+ os : [ubuntu, windows, macos]
166
+ node_version : [18]
167
+ include :
168
+ # Include LTS versions on Ubuntu
169
+ - os : ubuntu
170
+ node_version : 16
171
+ - os : ubuntu
172
+ node_version : 14
173
+
174
+ steps :
175
+ - uses : actions/checkout@v3
176
+ - uses : dart-lang/setup-dart@v1
177
+ with : {sdk: stable}
178
+ - run : dart pub get
179
+
180
+ - uses : ./.github/util/build-protobuf
181
+ with : {github-token: "${{ github.token }}"}
182
+
183
+ - name : Check out the embedded host
184
+ uses : sass/clone-linked-repo@v1
185
+ with : {repo: sass/embedded-host-node}
186
+
187
+ - name : Check out the JS API definition
188
+ uses : sass/clone-linked-repo@v1
189
+ with : {repo: sass/sass, path: language}
190
+
191
+ - name : Initialize embedded host
192
+ run : |
193
+ npm install
194
+ npm run init -- --protocol-path=../build/embedded-protocol \
195
+ --compiler-path=.. --api-path=../language
196
+ npm run compile
197
+ mv {`pwd`/,dist/}lib/src/vendor/dart-sass
198
+ working-directory : embedded-host-node
199
+
200
+ - name : Check out sass-spec
201
+ uses : sass/clone-linked-repo@v1
202
+ with : {repo: sass/sass-spec}
203
+
204
+ - name : Install sass-spec dependencies
205
+ run : npm install
206
+ working-directory : sass-spec
207
+
208
+ - name : Version info
209
+ run : |
210
+ path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass
211
+ if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version
212
+ elif [[ -f "$path.bat" ]]; then "./$path.bat" --version
213
+ elif [[ -f "$path.exe" ]]; then "./$path.exe" --version
214
+ else "./$path" --version
215
+ fi
216
+
217
+ - name : Run tests
218
+ run : npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../language
219
+ working-directory : sass-spec
220
+
106
221
dart_tests :
107
222
name : " Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}"
108
223
runs-on : " ${{ matrix.os }}"
@@ -119,9 +234,13 @@ jobs:
119
234
- uses : dart-lang/setup-dart@v1
120
235
with : {sdk: "${{ matrix.dart_channel }}"}
121
236
- run : dart pub get
237
+
238
+ - uses : ./.github/util/build-protobuf
239
+ with : {github-token: "${{ github.token }}"}
240
+
122
241
- run : dart run grinder pkg-standalone-dev
123
242
- name : Run tests
124
- run : dart run test -p vm -x node -r expanded
243
+ run : dart run test -p vm -x node
125
244
126
245
# Unit tests that use Node.js, defined in test/.
127
246
#
@@ -158,37 +277,13 @@ jobs:
158
277
- uses : actions/setup-node@v3
159
278
with : {node-version: "${{ matrix.node_version }}"}
160
279
- run : npm install
161
- - run : dart run grinder before-test
162
- - name : Run tests
163
- run : dart run test -j 2 -t node -r expanded
164
280
165
- static_analysis :
166
- name : Static analysis
167
- runs-on : ubuntu-latest
281
+ - uses : ./.github/util/build-protobuf
282
+ with : {github-token: "${{ github.token }}"}
168
283
169
- steps :
170
- - uses : actions/checkout@v3
171
- - uses : dart-lang/setup-dart@v1
172
- - run : dart pub get
173
- - name : Analyze Dart
174
- run : dart analyze --fatal-warnings --fatal-infos .
175
-
176
- dartdoc :
177
- name : Dartdoc
178
- runs-on : ubuntu-latest
179
-
180
- steps :
181
- - uses : actions/checkout@v3
182
- - uses : dart-lang/setup-dart@v1
183
- - run : dart pub get
184
- - name : dartdoc sass
185
- run : dart run dartdoc --quiet --no-generate-docs
186
- --errors ambiguous-doc-reference,broken-link,deprecated
187
- --errors unknown-directive,unknown-macro,unresolved-doc-reference
188
- - name : dartdoc sass_api
189
- run : cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs
190
- --errors ambiguous-doc-reference,broken-link,deprecated
191
- --errors unknown-directive,unknown-macro,unresolved-doc-reference
284
+ - run : dart run grinder before-test
285
+ - name : Run tests
286
+ run : dart run test -j 2 -t node
192
287
193
288
double_check :
194
289
name : Double-check
@@ -200,6 +295,7 @@ jobs:
200
295
- node_tests
201
296
- static_analysis
202
297
- dartdoc
298
+ - format
203
299
if : " startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
204
300
205
301
steps :
@@ -283,8 +379,11 @@ jobs:
283
379
284
380
steps :
285
381
- uses : actions/checkout@v3
382
+ -
uses :
bufbuild/[email protected]
383
+ with : {github_token: "${{ github.token }}"}
286
384
- uses : dart-lang/setup-dart@v1
287
385
- run : dart pub get
386
+ - run : dart run grinder protobuf
288
387
- name : Deploy
289
388
run : dart run grinder pkg-github-release pkg-github-linux-ia32 pkg-github-linux-x64
290
389
env :
@@ -306,6 +405,11 @@ jobs:
306
405
307
406
steps :
308
407
- uses : actions/checkout@v3
408
+ -
uses :
bufbuild/[email protected]
409
+ with : {github_token: "${{ github.token }}"}
410
+ - uses : dart-lang/setup-dart@v1
411
+ - run : dart pub get
412
+ - run : dart run grinder protobuf
309
413
- uses : docker/setup-qemu-action@v2
310
414
- name : Deploy
311
415
run : |
@@ -341,11 +445,14 @@ jobs:
341
445
342
446
steps :
343
447
- uses : actions/checkout@v3
448
+ -
uses :
bufbuild/[email protected]
449
+ with : {github_token: "${{ github.token }}"}
344
450
- uses : dart-lang/setup-dart@v1
345
451
# Workaround for dart-lang/setup-dart#59
346
452
with :
347
453
architecture : ${{ matrix.architecture }}
348
454
- run : dart pub get
455
+ - run : dart run grinder protobuf
349
456
- name : Deploy
350
457
run : dart run grinder pkg-github-${{ matrix.platform }}
351
458
env :
@@ -397,6 +504,7 @@ jobs:
397
504
- uses : actions/checkout@v3
398
505
- uses : dart-lang/setup-dart@v1
399
506
- run : dart pub get
507
+ - run : dart run grinder protobuf
400
508
- uses : actions/setup-node@v3
401
509
with : {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
402
510
- name : Deploy
@@ -455,7 +563,6 @@ jobs:
455
563
runs-on : ubuntu-latest
456
564
needs : [bootstrap, bourbon, foundation, bulma]
457
565
if : " startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
458
-
459
566
steps :
460
567
- uses : actions/checkout@v3
461
568
with :
@@ -469,58 +576,46 @@ jobs:
469
576
message : Cut a release for a new Dart Sass version
470
577
commit : --allow-empty
471
578
472
- release_embedded_compiler :
473
- name : " Release Embedded Compiler "
579
+ release_embedded_host :
580
+ name : " Release Embedded Host "
474
581
runs-on : ubuntu-latest
475
- needs : [deploy_pub, deploy_sub_packages]
476
- if : " startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
477
-
582
+ needs : [deploy_github_linux, deploy_github_linux_qemu, deploy_github]
583
+ if : " startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"
478
584
steps :
479
585
- uses : actions/checkout@v3
480
586
with :
481
- repository : sass/dart-sass-embedded
587
+ repository : sass/embedded-host-node
482
588
token : ${{ secrets.GH_TOKEN }}
483
- - uses : dart-lang/setup-dart@v1
484
- - uses : frenck/action-setup-yq@v1
485
- with : {version: v4.30.5} # frenck/action-setup-yq#35
486
589
487
590
- name : Get version
488
591
id : version
489
- run : |
490
- echo "sass=${GITHUB_REF##*/}" | tee --append $GITHUB_OUTPUT
491
- echo "sass_api=$(curl --fail --silent --show-error --location https://raw.githubusercontent.com/sass/dart-sass/${GITHUB_REF##*/}/pkg/sass_api/pubspec.yaml | yq .version)" | tee --append $GITHUB_OUTPUT
592
+ run : echo "::set-output name=version::${GITHUB_REF##*/}"
492
593
493
594
- name : Update version
494
595
run : |
495
- sed -i 's/version: .*/version: ${{ steps.version.outputs.sass }}/' pubspec.yaml
496
- dart pub remove sass_api
497
- dart pub remove sass
498
- dart pub add sass:${{ steps.version.outputs.sass }}
499
- dart pub add sass_api:^${{ steps.version.outputs.sass_api }}
500
-
501
- # Delete a dependency override on Sass if it exists, and delete the
502
- # dependency_overrides field if it's now empty. The embedded compiler
503
- # often uses dev dependencies to run against the latest Dart Sass, but
504
- # once we release the latest version that's no longer necessary.
505
- #
506
- # TODO(dart-lang/pub#3700): Use pub for this instead to avoid removing
507
- # blank lines. See also mikefarah/yq#515.
508
- yq -i '
509
- del(.dependency_overrides.sass) |
510
- to_entries |
511
- map(select(.key != "dependency_overrides" or (.value | length >0))) |
512
- from_entries
513
- ' pubspec.yaml
514
-
515
- # The embedded compiler has a checked-in pubspec.yaml, so upgrade to
516
- # make sure we're releasing against the latest version of all deps.
517
- dart pub upgrade
518
-
519
- curl --fail --silent --show-error --location --output CHANGELOG.md https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.sass }}/CHANGELOG.md
596
+ # Update binary package versions
597
+ for dir in $(ls npm); do
598
+ cat "npm/$dir/package.json" |
599
+ jq --arg version ${{ steps.version.outputs.version }} '
600
+ .version |= $version
601
+ ' > package.json.tmp &&
602
+ mv package.json.tmp "npm/$dir/package.json"
603
+ done
604
+
605
+ # Update main package version and dependencies on binary packages
606
+ cat package.json |
607
+ jq --arg version ${{ steps.version.outputs.version }} '
608
+ .version |= $version |
609
+ ."compiler-version" |= $version |
610
+ .optionalDependencies = (.optionalDependencies | .[] |= $version)
611
+ ' > package.json.tmp &&
612
+ mv package.json.tmp package.json
613
+ curl https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md
614
+ shell : bash
520
615
521
616
- uses : EndBug/add-and-commit@v8
522
617
with :
523
618
author_name : Sass Bot
524
619
525
620
message : Update Dart Sass version and release
526
- tag : ${{ steps.version.outputs.sass }}
621
+ tag : ${{ steps.version.outputs.version }}
0 commit comments