Dart CI #1428
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: Dart CI | |
on: | |
# Run on PRs and pushes to the default branch. | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: "0 0 * * 0" | |
env: | |
PUB_ENVIRONMENT: bot.github | |
permissions: read-all | |
jobs: | |
# Check code formatting and static analysis on a single OS (linux). | |
analyze: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: [3.4.0] | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- id: install | |
name: Install dependencies | |
run: dart pub upgrade | |
- name: Check formatting | |
run: dart format --output=none --set-exit-if-changed . | |
if: always() && steps.install.outcome == 'success' | |
- name: Analyze code | |
run: dart analyze --fatal-infos | |
if: always() && steps.install.outcome == 'success' | |
# Run tests on a matrix consisting of two dimensions: | |
# 1. OS: ubuntu-latest, macos-latest, (windows-latest) | |
# 2. release: 2.12.4 | |
test: | |
needs: analyze | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# TODO(sigurdm): our end2end test creates longer filenames than we can | |
# handle on windows. See https://github.com/dart-lang/sdk/issues/42416 | |
os: [ubuntu-latest, macos-latest] | |
sdk: [3.4.3] | |
flutter: [3.22.2] | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Setup Flutter | |
run: | | |
cd $HOME | |
git clone https://github.com/flutter/flutter.git --depth 1 -b ${{ matrix.flutter }} _flutter | |
echo "$HOME/_flutter/bin" >> $GITHUB_PATH | |
cd $GITHUB_WORKSPACE | |
- name: Check Flutter | |
run: flutter --version --machine | |
- id: install | |
name: Install dependencies | |
run: dart pub upgrade | |
- name: Run VM tests | |
# Run the tests -- include the default-skipped presubmit tests | |
# Run with concurrency = 1 – the build-test command edits files, which might | |
# crash other tests run in parallel | |
run: dart test --platform vm --run-skipped -j 1 | |
if: always() && steps.install.outcome == 'success' | |
# Runs tests on beta SDKs. | |
beta_e2e_light: | |
needs: analyze | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: '3.5.0-307.0.dev' # TODO: switch back to rolling 'dev' channel after it gets updated. | |
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 | |
with: | |
# flutter-version: '3.4.0-34.1.pre' | |
channel: 'master' # TODO: switch back to rolling 'dev' channel after it gets updated. | |
- name: Check Flutter | |
run: flutter --version --machine | |
- id: install | |
name: Install dependencies | |
run: dart pub upgrade | |
- name: Run end2end light tests | |
run: dart test --platform vm -j 1 test/end2end_light_test.dart | |
if: always() && steps.install.outcome == 'success' |