mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-26 20:24:42 +01:00
Merge pull request #66 from sass/link-prs
Allow PRs to be linked to the Dart Sass and embedded protocol repos
This commit is contained in:
commit
d9b98b48bb
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@ -27,8 +27,28 @@ jobs:
|
||||
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
||||
- uses: dart-lang/setup-dart@v1
|
||||
with: {sdk: "${{ matrix.dart_channel }}"}
|
||||
|
||||
- name: Check out Dart Sass
|
||||
uses: sass/clone-linked-repo@v1
|
||||
with:
|
||||
repo: sass/dart-sass
|
||||
path: build/dart-sass
|
||||
default-ref: null
|
||||
|
||||
- name: Add Dart Sass to pubspec
|
||||
run: >
|
||||
if [[ -d build/dart-sass ]]; then
|
||||
echo "dependency_overrides: {sass: {path: build/dart-sass}}" >> pubspec.yaml
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Check out embedded Sass protocol
|
||||
uses: sass/clone-linked-repo@v1
|
||||
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}
|
||||
|
||||
- run: dart pub get
|
||||
- run: dart pub run grinder protobuf
|
||||
env: {UPDATE_SASS_PROTOCOL: false}
|
||||
- run: dart pub run grinder pkg-standalone-dev
|
||||
- name: Run tests
|
||||
run: dart pub run test -r expanded
|
||||
@ -42,8 +62,28 @@ jobs:
|
||||
- uses: arduino/setup-protoc@v1
|
||||
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
||||
- uses: dart-lang/setup-dart@v1
|
||||
|
||||
- name: Check out Dart Sass
|
||||
uses: sass/clone-linked-repo@v1
|
||||
with:
|
||||
repo: sass/dart-sass
|
||||
path: build/dart-sass
|
||||
default-ref: null
|
||||
|
||||
- name: Add Dart Sass to pubspec
|
||||
run: >
|
||||
if [[ -d build/dart-sass ]]; then
|
||||
echo "dependency_overrides: {sass: {path: build/dart-sass}}" >> pubspec.yaml
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Check out embedded Sass protocol
|
||||
uses: sass/clone-linked-repo@v1
|
||||
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}
|
||||
|
||||
- run: dart pub get
|
||||
- run: dart pub run grinder protobuf
|
||||
env: {UPDATE_SASS_PROTOCOL: false}
|
||||
- name: Analyze dart
|
||||
run: dartanalyzer --fatal-warnings ./
|
||||
|
||||
|
@ -315,7 +315,7 @@ packages:
|
||||
name: sass
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.48.0"
|
||||
version: "1.49.0"
|
||||
sass_analysis:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -331,7 +331,7 @@ packages:
|
||||
name: sass_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0-beta.28"
|
||||
version: "1.0.0-beta.29"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass_embedded
|
||||
version: 1.0.0-beta.16
|
||||
version: 1.0.0-dev
|
||||
description: An implementation of the Sass embedded protocol using Dart Sass.
|
||||
homepage: https://github.com/sass/dart-sass-embedded
|
||||
|
||||
@ -14,7 +14,7 @@ dependencies:
|
||||
meta: ^1.1.0
|
||||
path: ^1.6.0
|
||||
protobuf: ^2.0.0
|
||||
sass: ^1.42.0
|
||||
sass: 1.49.0
|
||||
sass_api: ^1.0.0-beta.5
|
||||
source_span: ^1.1.0
|
||||
stack_trace: ^1.6.0
|
||||
|
30
test/dependencies_test.dart
Normal file
30
test/dependencies_test.dart
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:pubspec_parse/pubspec_parse.dart';
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
/// This package's pubspec.
|
||||
var _pubspec = Pubspec.parse(File('pubspec.yaml').readAsStringSync(),
|
||||
sourceUrl: Uri.parse('pubspec.yaml'));
|
||||
|
||||
void main() {
|
||||
// Assert that our declared dependency on Dart Sass is either a Git dependency
|
||||
// or the same version as the version we're testing against.
|
||||
|
||||
test('depends on a compatible version of Dart Sass', () {
|
||||
var sassDependency = _pubspec.dependencies['sass'];
|
||||
if (sassDependency is GitDependency) return;
|
||||
|
||||
var actualVersion =
|
||||
(Process.runSync('dart', ['run', 'sass', '--version']).stdout as String)
|
||||
.trim();
|
||||
expect(sassDependency, isA<HostedDependency>());
|
||||
expect(actualVersion,
|
||||
equals((sassDependency as HostedDependency).version.toString()));
|
||||
});
|
||||
}
|
@ -50,7 +50,10 @@ dart pub run protoc_plugin %*
|
||||
run('chmod', arguments: ['a+x', 'build/protoc-gen-dart']);
|
||||
}
|
||||
|
||||
await cloneOrPull("git://github.com/sass/embedded-protocol");
|
||||
if (Platform.environment['UPDATE_SASS_PROTOCOL'] != 'false') {
|
||||
await cloneOrPull("git://github.com/sass/embedded-protocol");
|
||||
}
|
||||
|
||||
await runAsync("protoc",
|
||||
arguments: [
|
||||
"-Ibuild/embedded-protocol",
|
||||
|
Loading…
Reference in New Issue
Block a user