Analyze and Test #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Analyze and Test | |
on: | |
# Run CI on pushes to the master branch, and on PRs against master. | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
# Check code formatting and static analysis on a single OS (linux) | |
# against Dart dev. | |
analyze: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sdk: [3.3.0, dev] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Report version | |
run: dart --version | |
- name: Install dependencies | |
run: dart pub get | |
- name: Check formatting (using dev dartfmt release) | |
if: ${{ matrix.sdk == 'dev' }} | |
run: dart format --output=none --set-exit-if-changed . | |
- name: Analyze code | |
run: dart analyze --fatal-infos . | |
test: | |
needs: analyze | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
sdk: [3.3.0, dev] | |
platform: [vm, chrome] | |
exclude: | |
# We only run Chrome tests on Linux. No need to run them | |
# on Windows and Mac because they are platform independent. | |
- os: windows-latest | |
platform: chrome | |
- os: macos-latest | |
platform: chrome | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Report version | |
run: dart --version | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run tests | |
run: dart test --platform ${{ matrix.platform }} |