Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature.color-4
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Aug 2, 2023
2 parents 70c8dc2 + 08eb143 commit 4a95cd3
Show file tree
Hide file tree
Showing 188 changed files with 8,966 additions and 4,039 deletions.
120 changes: 87 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defaults:
run: {shell: bash}

env:
PROTOC_VERSION: 3.x
# TODO(jathak): Update this to Node 18 once unit tests are fixed.
NODE_VERSION: 14

on:
Expand All @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
Expand All @@ -30,8 +30,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- run: npm run lint
Expand All @@ -41,8 +41,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install
- run: npm run lint-spec
Expand All @@ -57,19 +57,28 @@ jobs:
dart_channel: [stable, dev]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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 | dart pub get
run: dart pub get
working-directory: dart-sass
- name: Install dart-sass
run: |
GITHUB_REF=${PR_REF:-$CURRENT_REF}
if [[ "$GITHUB_REF" == refs/heads/feature.* ]]; then branch="${GITHUB_REF:11}"; else branch=main; fi
git clone https://github.com/sass/dart-sass.git ../dart-sass --depth 1 --branch "$branch"
(
cd ../dart-sass
dart pub get
dart run grinder protobuf
)
env:
PR_REF: "${{ github.base_ref }}"
CURRENT_REF: "${{ github.ref }}"

- name: Run specs
run: npm run sass-spec -- --dart dart-sass
Expand All @@ -80,8 +89,8 @@ jobs:
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip libsass')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: "${{ env.NODE_VERSION }}"}
- run: npm install

Expand All @@ -104,40 +113,53 @@ jobs:
# They next need to be rotated October 2021. See
# https://github.com/nodejs/Release.
js_api_dart_sass:
name: "JS API | Dart Sass | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
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: [16]
node_version: [18]
# Only test LTS versions on Ubuntu
include:
- os: ubuntu-latest
node_version: 12
- os: ubuntu-latest
node_version: 14
- os: ubuntu-latest
node_version: 16

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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: |
<<<<<<< HEAD
dart pub get
dart pub run grinder pkg-npm-dev
cd build/npm
npm install
working-directory: dart-sass
=======
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
)
>>>>>>> origin/main

- name: Check out Sass specification
uses: sass/clone-linked-repo@v1
Expand All @@ -148,37 +170,69 @@ jobs:
- 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 | sass-embedded | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
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: [16]
node_version: [18]
# Only test LTS versions on Ubuntu
include:
- os: ubuntu-latest
node_version: 12
- os: ubuntu-latest
node_version: 14
- os: ubuntu-latest
node_version: 16

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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: arduino/setup-protoc@v1
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: '${{ github.token }}'

# Clone linked versions of Dart Sass Embedded and the Embedded Protocol so
# that they match the current feature branch.
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,9 @@ arguments:

[Sass language specification repository]: https://github.com/sass/sass

The JS API specs are run using [Jest], so you can also pass any [Jest command
line arguments] to `npm run js-api-spec`.
The JS API specs are run using [Jasmine].

[Jest]: https://jestjs.io/
[Jest command line arguments]: https://jestjs.io/docs/cli
[Jasmine]: https://jasmine.github.io/

#### Dart Sass

Expand All @@ -354,12 +352,21 @@ git clone https://github.com/sass/dart-sass
)
export DART_SASS_PATH=`pwd`/dart-sass

npm run sass-spec -- --sassSass $SASS_SASS_PATH --sassPackage $DART_SASS_PATH/build/npm
npm run js-api-spec -- --sassSassRepo $SASS_SASS_PATH --sassPackage $DART_SASS_PATH/build/npm
```

Whenever you modify Dart Sass, make sure to re-run `dart run grinder
pkg-npm-dev` to rebuild the JavaScript output.

##### Browser Build

To run specs against [Dart Sass] compiled for a browser context, add the
`--browser` flag to the above command:

```sh
npm run js-api-spec -- --sassSassRepo $SASS_SASS_PATH --sassPackage $DART_SASS_PATH/build/npm --browser
```

#### Embedded Host

To run specs against [the Node Embedded Host], which embeds Dart Sass as a
Expand All @@ -385,7 +392,7 @@ git clone https://github.com/sass/embedded-host-node
)
export SASS_EMBEDDED_PATH=`pwd`/embedded-host-node

npm run sass-spec -- --sassSass $SASS_SASS_PATH --sassPackage $SASS_EMBEDDED_PATH
npm run js-api-spec -- --sassSassRepo $SASS_SASS_PATH --sassPackage $SASS_EMBEDDED_PATH
```

Whenever you modify the Sass embedded host, make sure to re-run `npm run
Expand Down
Loading

0 comments on commit 4a95cd3

Please sign in to comment.