name: CI env: protoc_version: '3.x' on: push: branches: [main, feature.*] 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 }}" } - 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 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 }}" } - 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 ./ 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 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 }}" } - uses: dart-lang/setup-dart@v1 - run: dart pub get - run: dart pub run grinder protobuf - name: Deploy run: dart pub run grinder pkg-github-release pkg-github-linux env: {GH_BEARER_TOKEN: "${{ github.token }}"} 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 }}" } - uses: dart-lang/setup-dart@v1 - run: dart pub get - run: dart pub run grinder protobuf - name: Deploy run: dart pub run grinder pkg-github-macos env: {GH_BEARER_TOKEN: "${{ github.token }}"} 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 }}" } - uses: dart-lang/setup-dart@v1 - run: dart pub get - run: dart pub run grinder protobuf - name: Deploy run: dart pub run grinder pkg-github-windows env: {GH_BEARER_TOKEN: "${{ github.token }}"}