2021-01-06 13:41:24 +01:00
|
|
|
name: CI
|
|
|
|
|
2021-01-08 23:36:24 +01:00
|
|
|
env:
|
|
|
|
# Run on Node 14 because node-fibers doesn't support odd-numbered Node
|
2021-01-09 01:03:09 +01:00
|
|
|
# versions. Note: when changing this, also change
|
|
|
|
# jobs.node_tests.strategy.matrix.node_version.
|
2021-01-08 23:36:24 +01:00
|
|
|
DEFAULT_NODE_VERSION: 14
|
|
|
|
|
2021-01-06 13:41:24 +01:00
|
|
|
on:
|
|
|
|
push:
|
2021-01-08 23:36:24 +01:00
|
|
|
branches: [master, feature.*]
|
|
|
|
tags: ['**']
|
2021-01-06 13:41:24 +01:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sass_spec:
|
|
|
|
name: "sass-spec | Dart ${{ matrix.dart_channel }} | ${{ matrix.async_label }}"
|
2021-01-08 23:36:24 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
dart_channel: [stable, dev]
|
|
|
|
async_label: [synchronous]
|
|
|
|
async_args: ['']
|
|
|
|
include:
|
|
|
|
- dart_channel: stable
|
|
|
|
async_label: asynchronous
|
|
|
|
async_args: '--cmd-args --async'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
|
|
|
with: {sdk: "${{ matrix.dart_channel }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
# Set up the environment to run the sass-spec runner which is written in Ruby
|
|
|
|
- name: Set up sass-spec
|
|
|
|
run: |
|
|
|
|
export sass_spec_ref=`tool/github-action/sass-spec-ref.sh`
|
|
|
|
git init sass-spec
|
|
|
|
git -C sass-spec fetch git://github.com/sass/sass-spec "$sass_spec_ref" --depth 1
|
|
|
|
git -C sass-spec checkout FETCH_HEAD
|
|
|
|
env:
|
|
|
|
PR_BRANCH: "${{ github.base_ref }}"
|
2021-01-13 22:06:56 +01:00
|
|
|
CURRENT_REF: "${{ github.ref }}"
|
2021-01-06 13:41:24 +01:00
|
|
|
PR_BODY: "${{ github.event.pull_request.body }}"
|
2021-02-18 21:54:50 +01:00
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
|
|
|
|
- run: npm install
|
|
|
|
working-directory: sass-spec
|
2021-01-06 13:41:24 +01:00
|
|
|
- name: Run specs
|
2021-02-18 21:54:50 +01:00
|
|
|
run: npm run sass-spec -- --dart .. $extra_args
|
2021-01-06 13:41:24 +01:00
|
|
|
working-directory: sass-spec
|
2021-01-08 23:36:24 +01:00
|
|
|
env: {extra_args: "${{ matrix.async_args }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
dart_tests:
|
|
|
|
name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}"
|
2021-01-08 23:36:24 +01:00
|
|
|
runs-on: "${{ matrix.os }}"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
dart_channel: [stable]
|
2021-01-08 23:36:24 +01:00
|
|
|
include: [{os: ubuntu-latest, dart_channel: dev}]
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
|
|
|
with: {sdk: "${{ matrix.dart_channel }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder pkg-standalone-dev
|
|
|
|
- name: Run tests
|
|
|
|
run: dart pub run test -p vm -x node -r expanded
|
|
|
|
|
|
|
|
# Unit tests that use Node.js, defined in test/.
|
|
|
|
#
|
|
|
|
# The versions should be kept up-to-date with the latest LTS Node releases.
|
|
|
|
# They next need to be rotated April 2021. See
|
|
|
|
# https://github.com/nodejs/Release.
|
|
|
|
node_tests:
|
|
|
|
name: "Node tests | Dart ${{ matrix.dart_channel }} | Node ${{ matrix.node_version }} | ${{ matrix.os }}"
|
2021-01-08 23:36:24 +01:00
|
|
|
runs-on: "${{ matrix.os }}"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
dart_channel: [stable]
|
2021-01-09 01:03:09 +01:00
|
|
|
node_version: [14]
|
2021-01-06 13:41:24 +01:00
|
|
|
include:
|
|
|
|
# Include LTS versions on Ubuntu
|
|
|
|
- os: ubuntu-latest
|
|
|
|
dart_channel: stable
|
|
|
|
node_version: 12
|
|
|
|
- os: ubuntu-latest
|
|
|
|
dart_channel: stable
|
|
|
|
node_version: 10
|
2021-05-20 02:31:39 +02:00
|
|
|
- os: ubuntu-latest
|
|
|
|
dart_channel: dev
|
|
|
|
node_version: "${{ env.DEFAULT_NODE_VERSION }}"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
|
|
|
with: {sdk: "${{ matrix.dart_channel }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- uses: actions/setup-node@v2
|
2021-01-08 23:36:24 +01:00
|
|
|
with: {node-version: "${{ matrix.node_version }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: npm install
|
|
|
|
- run: dart pub run grinder before-test
|
|
|
|
- name: Run tests
|
|
|
|
run: dart pub run test -j 2 -t node -r expanded
|
|
|
|
|
|
|
|
static_analysis:
|
|
|
|
name: Static analysis
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-05-20 02:29:16 +02:00
|
|
|
# TODO(nweiz): Use the latest Dart when dart-lang/sdk#45488
|
|
|
|
with: {sdk: 2.12.4}
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Analyze dart
|
|
|
|
run: dartanalyzer --fatal-warnings --fatal-infos lib tool test
|
|
|
|
|
|
|
|
sanity_checks:
|
|
|
|
name: Sanity checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sass_spec, dart_tests, node_tests, static_analysis]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Run checks
|
|
|
|
run: dart pub run grinder sanity-check-before-release
|
|
|
|
|
|
|
|
deploy_github_linux:
|
|
|
|
name: "Deploy Github: Linux"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-release pkg-github-linux
|
|
|
|
env:
|
2021-01-08 23:44:44 +01:00
|
|
|
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
|
|
|
|
GH_USER: sassbot
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_github_macos:
|
|
|
|
name: "Deploy Github: Mac OS"
|
|
|
|
runs-on: macos-latest
|
|
|
|
needs: [deploy_github_linux]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-macos
|
|
|
|
env:
|
2021-01-08 23:44:44 +01:00
|
|
|
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
|
|
|
|
GH_USER: sassbot
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_github_windows:
|
|
|
|
name: "Deploy Github: Windows"
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: [deploy_github_linux]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-windows
|
|
|
|
env:
|
2021-01-08 23:44:44 +01:00
|
|
|
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
|
|
|
|
GH_USER: sassbot
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_npm:
|
2021-01-08 23:36:24 +01:00
|
|
|
name: Deploy npm
|
2021-01-06 13:41:24 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- uses: actions/setup-node@v2
|
2021-01-08 23:36:24 +01:00
|
|
|
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-npm-deploy
|
|
|
|
env:
|
|
|
|
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
|
|
|
|
|
|
|
|
deploy_bazel:
|
2021-01-08 23:36:24 +01:00
|
|
|
name: Deploy Bazel
|
2021-01-06 13:41:24 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [deploy_npm]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- uses: actions/setup-node@v2
|
2021-01-08 23:36:24 +01:00
|
|
|
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder update-bazel
|
2021-01-12 01:37:46 +01:00
|
|
|
env:
|
|
|
|
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
|
|
|
|
GH_USER: sassbot
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_pub:
|
|
|
|
name: "Deploy Pub"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- uses: actions/setup-node@v2
|
2021-01-08 23:36:24 +01:00
|
|
|
with: {node-version: "${{ env.DEFAULT_NODE_VERSION }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-pub-deploy
|
2021-01-08 23:36:24 +01:00
|
|
|
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_homebrew:
|
|
|
|
name: "Deploy Homebrew"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-homebrew-update
|
|
|
|
env:
|
2021-01-08 23:44:44 +01:00
|
|
|
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
|
|
|
|
GH_USER: sassbot
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_chocolatey:
|
|
|
|
name: "Deploy Chocolatey"
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-12 01:50:10 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-02 21:32:59 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-06 13:41:24 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-chocolatey-deploy
|
2021-01-08 23:36:24 +01:00
|
|
|
env: {CHOCOLATEY_TOKEN: "${{ secrets.CHOCOLATEY_TOKEN }}"}
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
deploy_website:
|
|
|
|
name: "Deploy sass-lang.com"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [sanity_checks]
|
2021-01-09 05:04:57 +01:00
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass'"
|
2021-01-06 13:41:24 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Deploy
|
|
|
|
run: tool/github-action/deploy/heroku.sh
|
2021-01-08 23:36:24 +01:00
|
|
|
env: {HEROKU_TOKEN: "${{ secrets.HEROKU_TOKEN }}"}
|