Skip to content

Switch away from subosito/flutter-action@v2 #424

Switch away from subosito/flutter-action@v2

Switch away from subosito/flutter-action@v2 #424

Workflow file for this run

name: Dart
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 0" # every Sunday at 00:00 UTC
concurrency:
group: ci-${{ github.ref }}-0 # ensure only one build per branch is running at a time
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Install dependencies
run: dart pub get
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
- name: Analyze package and example source
run: dart analyze --fatal-infos .
- name: Check PANA score
run: |
dart pub global activate pana && \
dart pub global run pana --no-warning --exit-code-threshold=0 --json \
--flutter-sdk $(flutter --no-version-check --version --machine | jq -r '.flutterRoot')
- name: Publish Dry Run
run: dart pub publish --dry-run
- name: Generate test coverage
run: |
dart pub global activate coverage && \
dart pub global run coverage:test_with_coverage --branch-coverage --function-coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
test:
needs: build
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.channel != 'stable' }} # allow failures on beta/master channel
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
channel: [stable, beta, master]
steps:
- uses: actions/checkout@v4
- name: Setup runner
uses: ./.github/actions/setup-runner
with:
flutter-version: ${{ matrix.channel }}
- name: Run tests
run: dart test --reporter=expanded --concurrency=1