From 8e353d4675d37fddb84c9cd6532bca76b18eeade Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 3 Nov 2020 22:12:47 +0100 Subject: [PATCH] Create dart.yml (#383) --- .github/workflows/dart.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..9fb6b11 --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,49 @@ +name: Dart + +on: + # Run CI on pushes to the master branch, and on PRs against master. + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + # Check code formating and static analysis on a single OS (linux) + # against Dart stable and dev. + analyze: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: cedx/setup-dart@v2 + with: + release-channel: stable + - name: Report version + run: dart --version + - name: Install dependencies + run: dart pub get + - name: Check formatting + run: dart format --output=none --set-exit-if-changed . + - name: Analyze code + run: dart analyze + + # Run tests on a matrix consisting of three dimensions: + # 1. OS: mac, windows, linux + # 2. release channel: stable, dev + # 3. TODO: Dart execution mode: native, web + test: + needs: analyze + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + sdk: [stable, dev] + steps: + - uses: actions/checkout@v2 + - uses: cedx/setup-dart@v2 + - name: Report version + run: dart --version + - name: Install dependencies + run: dart pub get + - name: Run tests + run: dart test