Dart CI #953
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: | |
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, 2.17.0, 2.15.0, 2.12.0 ] | |
# rxdart: [ 0.27.5, 0.27.6, 0.27.7, not_override ] | |
sdk: [ beta, stable, 3.0.0 ] | |
rxdart: [ not_override ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Dart | |
uses: dart-lang/setup-dart@v1.4 | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Print Dart version | |
run: dart --version | |
- name: Override rxdart version to ${{ matrix.rxdart }} | |
if: ${{ matrix.rxdart != 'not_override' }} | |
run: sh tool/override_rxdart_version.sh | |
env: | |
RXDART_VERSION: ${{ matrix.rxdart }} | |
- name: Changes frontend_server_client to ^4.0.0 | |
if: ${{ matrix.sdk == 'stable' || matrix.sdk == 'beta' }} | |
run: sh tool/override_frontend_server_client_version.sh | |
- name: Install dependencies | |
run: dart pub get | |
- name: Analyze | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
run: dart analyze lib --fatal-infos --fatal-warnings | |
- name: Format code | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
run: dart format . --set-exit-if-changed | |
- name: Active coverage | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
run: dart pub global activate coverage | |
- name: Run tests | |
run: dart pub run test test/rxdart_ext_test.dart --chain-stack-traces | |
- name: Start Observatory | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
run: dart --disable-service-auth-codes --enable-vm-service=8111 --pause-isolates-on-exit --enable-asserts test/rxdart_ext_test.dart & | |
- name: Collect coverage | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
run: nohup dart pub global run coverage:collect_coverage --port=8111 --out=coverage.json --wait-paused --resume-isolates | |
- name: Format coverage | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
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 | |
if: ${{ matrix.sdk == 'stable' && matrix.rxdart == 'not_override' }} | |
with: | |
fail_ci_if_error: true # optional (default = false) | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
verbose: true # optional (default = false) |