Skip to content

Improve CI pipeline #116

Improve CI pipeline

Improve CI pipeline #116

Workflow file for this run

name: Dart CI
on:
push:
branches:
- main
pull_request:
env:
MINIMUM_PANA_SCORE: 150
jobs:
format:
name: Verify code formatting
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart --version && dart pub get
- name: Verify formatting
run: dart format --set-exit-if-changed .
lints:
name: Analyze source code
needs: [format]
runs-on: ubuntu-slim
strategy:
fail-fast: false
matrix:
sdk: [3.6, stable, dev]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Install dependencies
run: dart --version && dart pub get
- name: Analyze project source
run: dart analyze
package_health:
name: Analyze package health
needs: [lints]
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart --version && dart pub get && dart pub global activate pana
- name: Run package analyzer
run: dart pub global run pana --exit-code-threshold $MINIMUM_PANA_SCORE
test:
name: Run tests
needs: [lints]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
sdk: [stable, dev]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- uses: browser-actions/setup-chrome@v2
- name: Install dependencies
run: dart --version && dart pub get
- name: Run tests (VM)
run: dart test --platform vm
- name: Run tests (Chrome, JS)
run: dart test --platform chrome --compiler dart2js
- name: Run tests (Chrome, WASM)
run: dart test --platform chrome --compiler dart2wasm