Skip to content

Dart CI

Dart CI #184

Workflow file for this run

name: Dart CI
on:
push:
branches: [ master ]
paths-ignore: [ '**.md' ]
pull_request:
branches: [ master ]
paths-ignore: [ '**.md' ]
schedule:
# Runs at 02:00 UTC on the 1, 4, 7, 10, 13, 16, 19, 22, 25, 28 and 31st of every month.
- cron: "0 2 */3 * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [ beta, stable, 3.0.0 ]
steps:
- uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1.6.5
with:
sdk: ${{ matrix.sdk }}
- name: Print Dart version
run: dart --version
- name: Install dependencies
run: dart pub get
- name: Analyze
if: ${{ matrix.sdk == 'stable' }}
run: dart analyze lib --fatal-infos --fatal-warnings
- name: Format code
if: ${{ matrix.sdk == 'stable' }}
run: dart format . --set-exit-if-changed
- name: Active coverage
run: dart pub global activate coverage
- name: Run tests
run: dart pub run test test/cancellation_token_hoc081098_test.dart --chain-stack-traces
- name: Start Observatory
run: dart --disable-service-auth-codes --enable-vm-service=8111 --pause-isolates-on-exit --enable-asserts test/cancellation_token_hoc081098_test.dart &
- name: Collect coverage
run: nohup dart pub global run coverage:collect_coverage --port=8111 --out=coverage.json --wait-paused --resume-isolates
- name: Format coverage
run: dart pub global run coverage:format_coverage --lcov --in=coverage.json --out=lcov.info --report-on=lib
- uses: codecov/codecov-action@v4.5.0
with:
fail_ci_if_error: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)