2021-01-20 22:21:05 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
env:
|
|
|
|
protoc_version: '3.x'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-06-30 01:14:01 +02:00
|
|
|
branches: [main, feature.*]
|
2021-01-20 22:21:05 +01:00
|
|
|
tags: ['**']
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dart_tests:
|
|
|
|
name: "Dart tests | Dart ${{ matrix.dart_channel }} | ${{ matrix.os }}"
|
|
|
|
runs-on: "${{ matrix.os }}"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
dart_channel: [stable]
|
|
|
|
include: [{os: ubuntu-latest, dart_channel: dev}]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: arduino/setup-protoc@v1
|
|
|
|
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
2021-03-03 19:25:28 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
|
|
|
with: {sdk: "${{ matrix.dart_channel }}"}
|
2022-01-25 03:29:11 +01:00
|
|
|
|
|
|
|
- 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}
|
|
|
|
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder protobuf
|
2022-01-25 03:29:11 +01:00
|
|
|
env: {UPDATE_SASS_PROTOCOL: false}
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub run grinder pkg-standalone-dev
|
|
|
|
- name: Run tests
|
|
|
|
run: dart pub run test -r expanded
|
|
|
|
|
|
|
|
static_analysis:
|
|
|
|
name: Static analysis
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: arduino/setup-protoc@v1
|
|
|
|
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
2021-03-03 19:25:28 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2022-01-25 03:29:11 +01:00
|
|
|
|
|
|
|
- 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}
|
|
|
|
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder protobuf
|
2022-01-25 03:29:11 +01:00
|
|
|
env: {UPDATE_SASS_PROTOCOL: false}
|
2021-01-20 22:21:05 +01:00
|
|
|
- name: Analyze dart
|
|
|
|
run: dartanalyzer --fatal-warnings ./
|
|
|
|
|
2021-06-14 21:44:31 +02:00
|
|
|
format:
|
|
|
|
name: Code formatting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dart-lang/setup-dart@v1
|
|
|
|
- run: dart format --fix .
|
|
|
|
- run: git diff --exit-code
|
|
|
|
|
2021-01-20 22:21:05 +01:00
|
|
|
deploy_github_linux:
|
|
|
|
name: "Deploy Github: Linux"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [dart_tests, static_analysis]
|
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: arduino/setup-protoc@v1
|
|
|
|
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
2021-03-03 19:25:28 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder protobuf
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-release pkg-github-linux
|
2021-01-21 01:32:18 +01:00
|
|
|
env: {GH_BEARER_TOKEN: "${{ github.token }}"}
|
2021-01-20 22:21:05 +01:00
|
|
|
|
|
|
|
deploy_github_macos:
|
|
|
|
name: "Deploy Github: Mac OS"
|
|
|
|
runs-on: macos-latest
|
|
|
|
needs: [deploy_github_linux]
|
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: arduino/setup-protoc@v1
|
|
|
|
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
2021-03-03 19:25:28 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder protobuf
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-macos
|
2021-01-21 01:32:18 +01:00
|
|
|
env: {GH_BEARER_TOKEN: "${{ github.token }}"}
|
2021-01-20 22:21:05 +01:00
|
|
|
|
|
|
|
deploy_github_windows:
|
|
|
|
name: "Deploy Github: Windows"
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: [deploy_github_linux]
|
|
|
|
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: arduino/setup-protoc@v1
|
|
|
|
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
|
2021-03-03 19:25:28 +01:00
|
|
|
- uses: dart-lang/setup-dart@v1
|
2021-01-20 22:21:05 +01:00
|
|
|
- run: dart pub get
|
|
|
|
- run: dart pub run grinder protobuf
|
|
|
|
- name: Deploy
|
|
|
|
run: dart pub run grinder pkg-github-windows
|
2021-01-21 01:32:18 +01:00
|
|
|
env: {GH_BEARER_TOKEN: "${{ github.token }}"}
|