forked from sass/dart-sass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'embedded-move' into embedded
- Loading branch information
Showing
39 changed files
with
5,739 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build Protobuf | ||
description: Check out and build the Dart Sass embedded protocol buffer. | ||
inputs: | ||
github-token: {required: true} | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: bufbuild/[email protected] | ||
with: {github_token: "${{ inputs.github-token }}"} | ||
|
||
- name: Check out embedded Sass protocol | ||
uses: sass/clone-linked-repo@v1 | ||
with: {repo: sass/embedded-protocol, path: build/embedded-protocol} | ||
|
||
- name: Generate Dart from protobuf | ||
run: dart run grinder protobuf | ||
env: {UPDATE_SASS_PROTOCOL: false} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,48 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
format: | ||
name: Code formatting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart format --fix . | ||
- run: git diff --exit-code | ||
|
||
static_analysis: | ||
name: Static analysis | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
|
||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Analyze Dart | ||
run: dart analyze --fatal-warnings ./ | ||
|
||
dartdoc: | ||
name: Dartdoc | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- name: dartdoc sass | ||
run: dart run dartdoc --quiet --no-generate-docs | ||
--errors ambiguous-doc-reference,broken-link,deprecated | ||
--errors unknown-directive,unknown-macro,unresolved-doc-reference | ||
- name: dartdoc sass_api | ||
run: cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs | ||
--errors ambiguous-doc-reference,broken-link,deprecated | ||
--errors unknown-directive,unknown-macro,unresolved-doc-reference | ||
|
||
sass_spec_language: | ||
name: "Language Tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}" | ||
runs-on: ubuntu-latest | ||
|
@@ -43,6 +85,10 @@ jobs: | |
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"} | ||
- run: npm install | ||
working-directory: sass-spec | ||
|
||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Run specs | ||
run: npm run sass-spec -- --dart .. $extra_args | ||
working-directory: sass-spec | ||
|
@@ -52,7 +98,7 @@ jobs: | |
# They next need to be rotated April 2021. See | ||
# https://github.com/nodejs/Release. | ||
sass_spec_js: | ||
name: "JS API Tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node_version }} | ${{ matrix.os }}" | ||
name: "JS API Tests | Pure JS | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node_version }} | ${{ matrix.os }}" | ||
runs-on: "${{ matrix.os }}" | ||
|
||
strategy: | ||
|
@@ -82,6 +128,9 @@ jobs: | |
with: {node-version: "${{ matrix.node_version }}"} | ||
- run: npm install | ||
|
||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Check out sass-spec | ||
uses: sass/clone-linked-repo@v1 | ||
with: {repo: sass/sass-spec} | ||
|
@@ -103,6 +152,72 @@ jobs: | |
run: npm run js-api-spec -- --sassSassRepo ../language --sassPackage ../build/npm | ||
working-directory: sass-spec | ||
|
||
# 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. | ||
sass_spec_js_embedded: | ||
name: 'JS API Tests | Embedded | Node ${{ matrix.node_version }} | ${{ matrix.os }}' | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, windows, macos] | ||
node_version: [18] | ||
include: | ||
# Include LTS versions on Ubuntu | ||
- os: ubuntu | ||
node_version: 16 | ||
- os: ubuntu | ||
node_version: 14 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: {sdk: stable} | ||
- run: dart pub get | ||
|
||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Check out the embedded host | ||
uses: sass/clone-linked-repo@v1 | ||
with: {repo: sass/embedded-host-node} | ||
|
||
- name: Check out the JS API definition | ||
uses: sass/clone-linked-repo@v1 | ||
with: {repo: sass/sass, path: language} | ||
|
||
- name: Initialize embedded host | ||
run: | | ||
npm install | ||
npm run init -- --protocol-path=../build/embedded-protocol \ | ||
--compiler-path=.. --api-path=../language | ||
npm run compile | ||
mv {`pwd`/,dist/}lib/src/vendor/dart-sass | ||
working-directory: embedded-host-node | ||
|
||
- name: Check out sass-spec | ||
uses: sass/clone-linked-repo@v1 | ||
with: {repo: sass/sass-spec} | ||
|
||
- name: Install sass-spec dependencies | ||
run: npm install | ||
working-directory: sass-spec | ||
|
||
- name: Version info | ||
run: | | ||
path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass | ||
if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version | ||
elif [[ -f "$path.bat" ]]; then "./$path.bat" --version | ||
elif [[ -f "$path.exe" ]]; then "./$path.exe" --version | ||
else "./$path" --version | ||
fi | ||
- name: Run tests | ||
run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../language | ||
working-directory: sass-spec | ||
|
||
dart_tests: | ||
name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}" | ||
runs-on: "${{ matrix.os }}" | ||
|
@@ -119,9 +234,13 @@ jobs: | |
- uses: dart-lang/setup-dart@v1 | ||
with: {sdk: "${{ matrix.dart_channel }}"} | ||
- run: dart pub get | ||
|
||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- run: dart run grinder pkg-standalone-dev | ||
- name: Run tests | ||
run: dart run test -p vm -x node -r expanded | ||
run: dart run test -p vm -x node | ||
|
||
# Unit tests that use Node.js, defined in test/. | ||
# | ||
|
@@ -158,37 +277,13 @@ jobs: | |
- uses: actions/setup-node@v3 | ||
with: {node-version: "${{ matrix.node_version }}"} | ||
- run: npm install | ||
- run: dart run grinder before-test | ||
- name: Run tests | ||
run: dart run test -j 2 -t node -r expanded | ||
|
||
static_analysis: | ||
name: Static analysis | ||
runs-on: ubuntu-latest | ||
- uses: ./.github/util/build-protobuf | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- name: Analyze Dart | ||
run: dart analyze --fatal-warnings --fatal-infos . | ||
|
||
dartdoc: | ||
name: Dartdoc | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- name: dartdoc sass | ||
run: dart run dartdoc --quiet --no-generate-docs | ||
--errors ambiguous-doc-reference,broken-link,deprecated | ||
--errors unknown-directive,unknown-macro,unresolved-doc-reference | ||
- name: dartdoc sass_api | ||
run: cd pkg/sass_api && dart run dartdoc --quiet --no-generate-docs | ||
--errors ambiguous-doc-reference,broken-link,deprecated | ||
--errors unknown-directive,unknown-macro,unresolved-doc-reference | ||
- run: dart run grinder before-test | ||
- name: Run tests | ||
run: dart run test -j 2 -t node | ||
|
||
double_check: | ||
name: Double-check | ||
|
@@ -200,6 +295,7 @@ jobs: | |
- node_tests | ||
- static_analysis | ||
- dartdoc | ||
- format | ||
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" | ||
|
||
steps: | ||
|
@@ -283,8 +379,11 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: bufbuild/[email protected] | ||
with: {github_token: "${{ github.token }}"} | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- run: dart run grinder protobuf | ||
- name: Deploy | ||
run: dart run grinder pkg-github-release pkg-github-linux-ia32 pkg-github-linux-x64 | ||
env: | ||
|
@@ -306,6 +405,11 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: bufbuild/[email protected] | ||
with: {github_token: "${{ github.token }}"} | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- run: dart run grinder protobuf | ||
- uses: docker/setup-qemu-action@v2 | ||
- name: Deploy | ||
run: | | ||
|
@@ -341,11 +445,14 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: bufbuild/[email protected] | ||
with: {github_token: "${{ github.token }}"} | ||
- uses: dart-lang/setup-dart@v1 | ||
# Workaround for dart-lang/setup-dart#59 | ||
with: | ||
architecture: ${{ matrix.architecture }} | ||
- run: dart pub get | ||
- run: dart run grinder protobuf | ||
- name: Deploy | ||
run: dart run grinder pkg-github-${{ matrix.platform }} | ||
env: | ||
|
@@ -397,6 +504,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- run: dart pub get | ||
- run: dart run grinder protobuf | ||
- uses: actions/setup-node@v3 | ||
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"} | ||
- name: Deploy | ||
|
@@ -455,7 +563,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [bootstrap, bourbon, foundation, bulma] | ||
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -469,58 +576,46 @@ jobs: | |
message: Cut a release for a new Dart Sass version | ||
commit: --allow-empty | ||
|
||
release_embedded_compiler: | ||
name: "Release Embedded Compiler" | ||
release_embedded_host: | ||
name: "Release Embedded Host" | ||
runs-on: ubuntu-latest | ||
needs: [deploy_pub, deploy_sub_packages] | ||
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'" | ||
|
||
needs: [deploy_github_linux, deploy_github_linux_qemu, deploy_github] | ||
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: sass/dart-sass-embedded | ||
repository: sass/embedded-host-node | ||
token: ${{ secrets.GH_TOKEN }} | ||
- uses: dart-lang/setup-dart@v1 | ||
- uses: frenck/action-setup-yq@v1 | ||
with: {version: v4.30.5} # frenck/action-setup-yq#35 | ||
|
||
- name: Get version | ||
id: version | ||
run: | | ||
echo "sass=${GITHUB_REF##*/}" | tee --append $GITHUB_OUTPUT | ||
echo "sass_api=$(curl --fail --silent --show-error --location https://raw.githubusercontent.com/sass/dart-sass/${GITHUB_REF##*/}/pkg/sass_api/pubspec.yaml | yq .version)" | tee --append $GITHUB_OUTPUT | ||
run: echo "::set-output name=version::${GITHUB_REF##*/}" | ||
|
||
- name: Update version | ||
run: | | ||
sed -i 's/version: .*/version: ${{ steps.version.outputs.sass }}/' pubspec.yaml | ||
dart pub remove sass_api | ||
dart pub remove sass | ||
dart pub add sass:${{ steps.version.outputs.sass }} | ||
dart pub add sass_api:^${{ steps.version.outputs.sass_api }} | ||
# Delete a dependency override on Sass if it exists, and delete the | ||
# dependency_overrides field if it's now empty. The embedded compiler | ||
# often uses dev dependencies to run against the latest Dart Sass, but | ||
# once we release the latest version that's no longer necessary. | ||
# | ||
# TODO(dart-lang/pub#3700): Use pub for this instead to avoid removing | ||
# blank lines. See also mikefarah/yq#515. | ||
yq -i ' | ||
del(.dependency_overrides.sass) | | ||
to_entries | | ||
map(select(.key != "dependency_overrides" or (.value | length >0))) | | ||
from_entries | ||
' pubspec.yaml | ||
# The embedded compiler has a checked-in pubspec.yaml, so upgrade to | ||
# make sure we're releasing against the latest version of all deps. | ||
dart pub upgrade | ||
curl --fail --silent --show-error --location --output CHANGELOG.md https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.sass }}/CHANGELOG.md | ||
# Update binary package versions | ||
for dir in $(ls npm); do | ||
cat "npm/$dir/package.json" | | ||
jq --arg version ${{ steps.version.outputs.version }} ' | ||
.version |= $version | ||
' > package.json.tmp && | ||
mv package.json.tmp "npm/$dir/package.json" | ||
done | ||
# Update main package version and dependencies on binary packages | ||
cat package.json | | ||
jq --arg version ${{ steps.version.outputs.version }} ' | ||
.version |= $version | | ||
."compiler-version" |= $version | | ||
.optionalDependencies = (.optionalDependencies | .[] |= $version) | ||
' > package.json.tmp && | ||
mv package.json.tmp package.json | ||
curl https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md | ||
shell: bash | ||
|
||
- uses: EndBug/add-and-commit@v8 | ||
with: | ||
author_name: Sass Bot | ||
author_email: [email protected] | ||
message: Update Dart Sass version and release | ||
tag: ${{ steps.version.outputs.sass }} | ||
tag: ${{ steps.version.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ package-lock.json | |
node_modules/ | ||
/doc/api | ||
/pkg/*/doc/api | ||
|
||
# Generated protocol buffer files. | ||
*.pb*.dart |
Oops, something went wrong.