Skip to content

Commit 17f7fab

Browse files
authored
Pull more repeated GH Action tasks into sub-actions (#1964)
This converts the build-protobuf action into a general action that initializes Dart _and_ builds the protobuf. It also factors out the repeated work to set up the sass-spec repo.
1 parent 4692841 commit 17f7fab

File tree

4 files changed

+134
-142
lines changed

4 files changed

+134
-142
lines changed

.github/util/build-protobuf/action.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/util/initialize/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Initialize
2+
description: Check out Dart Sass and build the embedded protocol buffer.
3+
inputs:
4+
github-token: {required: true}
5+
node-version: {required: false, default: 18}
6+
dart-sdk: {required: false, default: stable}
7+
architecture: {required: false}
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: dart-lang/setup-dart@v1
12+
with:
13+
sdk: "${{ inputs.sdk }}"
14+
architecture: "${{ inputs.architecture }}"
15+
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: "${{ inputs.node-version }}"
19+
20+
- run: dart pub get
21+
shell: bash
22+
23+
- run: npm install
24+
shell: bash
25+
26+
- uses: bufbuild/[email protected]
27+
with: {github_token: "${{ inputs.github-token }}"}
28+
29+
- name: Check out embedded Sass protocol
30+
uses: sass/clone-linked-repo@v1
31+
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}
32+
33+
- name: Generate Dart from protobuf
34+
run: dart run grinder protobuf
35+
env: {UPDATE_SASS_PROTOCOL: false}
36+
shell: bash

.github/util/sass-spec/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: sass-spec
2+
description: Check out sass-spec and install its dependencies.
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Check out sass-spec
7+
uses: sass/clone-linked-repo@v1
8+
with: {repo: sass/sass-spec}
9+
10+
- run: npm install
11+
working-directory: sass-spec
12+
shell: bash

0 commit comments

Comments
 (0)