Skip to content

Commit

Permalink
Update CI and CONTRIBUTING to use Node spec runner (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak committed Feb 18, 2021
1 parent 881ff12 commit a021ae2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ jobs:
PR_BRANCH: "${{ github.base_ref }}"
CURRENT_REF: "${{ github.ref }}"
PR_BODY: "${{ github.event.pull_request.body }}"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
working-directory: sass-spec
bundler-cache: true
- uses: actions/setup-node@v2
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
- run: npm install
working-directory: sass-spec
- name: Run specs
run: bundle exec sass-spec.rb --dart .. $extra_args
run: npm run sass-spec -- --dart .. $extra_args
working-directory: sass-spec
env: {extra_args: "${{ matrix.async_args }}"}

Expand Down
31 changes: 13 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ one above, the
2. In this repository, run `pub get`. This will install all of the Dart
dependencies.

3. [Install Node.js][]. This is only necessary if you're making changes to Dart
Sass's Node API.
3. [Install Node.js][]. This is only necessary if you're making changes to the
language or to Dart Sass's Node API.

[Install the Dart SDK]: https://www.dartlang.org/install
[Install Node.js]: https://nodejs.org/en/download/
Expand Down Expand Up @@ -91,13 +91,13 @@ To create a new spec:

* [Fork sass-spec](https://help.github.com/articles/fork-a-repo/).

* Install [Ruby][] and [Bundler][].
* [Install Node.js][] v14.14 or newer.

* ```sh
# Replace $USER with your GitHub username.
git clone https://github.com/$USER/sass-spec
cd sass-spec
bundle install
npm install
```

* For each test case you want to add:
Expand All @@ -108,18 +108,16 @@ To create a new spec:

* Following the [spec style guide][], create an `hrx` file that exercises your
language change, verifying that the change produces expected output/errors.

[spec style guide]: https://github.com/sass/sass-spec/blob/master/STYLE_GUIDE.md

* If you're adding a new language feature, it probably won't be supported by
Ruby Sass or LibSass yet. You can indicate this and keep tests passing by
adding an `options.yml` file like this to the directory containing your
tests:
LibSass yet. You can indicate this and keep tests passing by adding an
`options.yml` file like this to the directory containing your tests:

```yaml
---
:todo:
- ruby-sass
- libsass
```

Expand All @@ -131,16 +129,16 @@ To create a new spec:

```sh
# Replace .. with the path to dart-sass if it's not the parent directory.
bundle exec sass-spec.rb --dart ..
npm run sass-spec -- --dart ..
```

* You can also run specs within a single directory:

```sh
bundle exec sass-spec.rb --dart .. spec/my/new/feature
npm run sass-spec --dart .. spec/my/new/feature
```

* If you pass the `--interactive` flag, `sass-spec.rb` will stop each time a
* If you pass the `--interactive` flag, the spec runner will stop each time a
spec fails and ask you what to do about the failure.

* Once you've added specs and they're passing for Dart Sass, create a pull
Expand All @@ -152,9 +150,6 @@ To create a new spec:
request at the end of the message. This tells Dart Sass to test against your
new sass-spec tests.
[Ruby]: https://www.ruby-lang.org/en/
[Bundler]: http://bundler.io/
### Changing the Node API
Most of Dart Sass's code is shared between Dart and Node.js, but the API that's
Expand Down Expand Up @@ -209,7 +204,7 @@ automating.
All files in the project must start with the following header.
```dart
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Copyright 2021 Google LLC. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
```

0 comments on commit a021ae2

Please sign in to comment.