-
Notifications
You must be signed in to change notification settings - Fork 89
249 lines (213 loc) · 7.68 KB
/
ci.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
name: CI
defaults:
run: {shell: bash}
env:
# TODO(jathak): Update this to Node 18 once unit tests are fixed.
NODE_VERSION: 14
on:
push: {branches: [main, feature.*]}
pull_request:
jobs:
unit_tests:
name: "Unit tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
- run: npm install
- run: npm test
static_analysis:
name: "Static analysis"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- run: npm run lint
lint_spec:
name: "Lint spec files"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- run: npm run lint-spec
dart_sass_language:
name: "Language | Dart Sass | Dart ${{ matrix.dart_channel }}"
runs-on: ubuntu-latest
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip dart-sass')"
strategy:
matrix:
dart_channel: [stable, dev]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- uses: dart-lang/setup-dart@v1
with: {sdk: "${{ matrix.dart_channel }}"}
- uses: bufbuild/[email protected]
with: {github_token: "${{ github.token }}"}
- name: Dart Sass | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/dart-sass, path: dart-sass}
- name: Dart Sass | Install
run: |
dart pub get
dart run grinder protobuf
working-directory: dart-sass
- name: Run specs
run: npm run sass-spec -- --dart dart-sass
libsass:
name: "Language | LibSass"
runs-on: ubuntu-latest
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip libsass')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- name: Install SassC
run: |
export SASS_LIBSASS_PATH=$BUILD_DIR/../libsass
export SASS_SASSC_PATH=$BUILD_DIR/../sassc
git clone https://github.com/sass/libsass.git $SASS_LIBSASS_PATH
(cd $SASS_LIBSASS_PATH; git checkout $GITISH)
git clone https://github.com/sass/sassc.git $SASS_SASSC_PATH
(cd $SASS_SASSC_PATH; git checkout $GITISH)
make -C $SASS_SASSC_PATH
env:
BUILD_DIR: "${{ github.workspace }}"
- name: Run specs
run: npm run sass-spec -- --impl libsass -c ../sassc/bin/sassc
# The versions should be kept up-to-date with the latest LTS Node releases.
# They next need to be rotated October 2021. See
# https://github.com/nodejs/Release.
js_api_dart_sass:
name: "JS API | Pure JS | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip dart-sass')"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node_version: [18]
# Only test LTS versions on Ubuntu
include:
- os: ubuntu-latest
node_version: 14
- os: ubuntu-latest
node_version: 16
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ matrix.node_version }}"}
- run: npm install
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
- uses: bufbuild/[email protected]
with: {github_token: "${{ github.token }}"}
- name: Dart Sass | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/dart-sass, path: dart-sass}
- name: Dart Sass | Install
run: |
dart pub get
dart pub run grinder protobuf pkg-npm-dev
cd build/npm
npm install
working-directory: dart-sass
- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
with:
repo: sass/sass
path: language
- name: Run specs
run: npm run js-api-spec -- --sassPackage dart-sass/build/npm --sassSassRepo language
js_api_dart_sass_browser:
name: "JS API | Pure JS | Browser"
runs-on: ubuntu-latest
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip dart-sass')"
steps:
- uses: actions/checkout@v3
- uses: browser-actions/setup-chrome@v1
- run: npm install
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
- uses: bufbuild/[email protected]
with: {github_token: "${{ github.token }}"}
- name: Install Dart Sass
run: |
git clone https://github.com/sass/dart-sass.git ../dart-sass --depth 1
(
cd ../dart-sass
dart pub get
dart pub run grinder protobuf pkg-npm-dev
cd build/npm
npm install
)
- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
with:
repo: sass/sass
path: language
- name: Run specs
run: npm run js-api-spec -- --sassPackage ../dart-sass/build/npm --sassSassRepo language --browser
env:
CHROME_EXECUTABLE: chrome
# The versions should be kept up-to-date with the latest LTS Node releases.
# They next need to be rotated October 2021. See
# https://github.com/nodejs/Release.
js_api_sass_embedded:
name: "JS API | 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: [18]
# Only test LTS versions on Ubuntu
include:
- os: ubuntu-latest
node_version: 14
- os: ubuntu-latest
node_version: 16
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ matrix.node_version }}"}
- run: npm install
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
# Clone linked versions of Dart Sass Embedded and the Embedded Protocol so
# that they match the current feature branch.
- name: Dart Sass Embedded | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/dart-sass-embedded, path: dart-sass-embedded}
- name: Embedded Protocol | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/embedded-protocol, path: embedded-protocol}
- name: Node.js Embedded Host | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/embedded-host-node, path: embedded-host-node}
- name: Node.js Embedded Host | Install
run: |
npm install
npm run init -- \
--compiler-path=../dart-sass-embedded \
--protocol-path=../embedded-protocol
npm run compile
working-directory: embedded-host-node
- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
with:
repo: sass/sass
path: language
- name: Run specs
run: npm run js-api-spec -- --sassPackage embedded-host-node --sassSassRepo language