Skip to content

Setup Mono Repo Using Melos #10

Setup Mono Repo Using Melos

Setup Mono Repo Using Melos #10

Workflow file for this run

name: Dart
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# All the packages are specified by their name and not path.
# This is because the package is passed to the 'melos exec' command
package:
- talker
- talker_bloc_logger
- talker_dio_logger
- talker_flutter
- talker_http_logger
- talker_logger
- talker_riverpod_logger
include:
- package: talker
path: packages
test: true
- package: talker_bloc_logger
path: packages
test: true
- package: talker_dio_logger
path: packages
test: true
- package: talker_flutter
path: packages
test: false
- package: talker_http_logger
path: packages
test: true
- package: talker_logger
path: packages
test: true
- package: talker_riverpod_logger
path: packages
test: true
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Install dependencies
run: |
dart pub global activate melos
dart pub get
dart run melos bs
- name: Format package
run: melos exec --scope="${{ matrix.package }}" -- dart format . --set-exit-if-changed
- name: Analyze package
run: melos exec --scope="${{ matrix.package }}" -- dart analyze --fatal-infos
- name: Run tests
if: matrix.test
run: melos exec --scope="${{ matrix.package }}" -- flutter test --coverage
- name: Check Code Coverage
if: matrix.test
uses: VeryGoodOpenSource/[email protected]
with:
path: ${{ matrix.path }}/${{ matrix.package }}/coverage/lcov.info
min_coverage: 90
- name: Upload coverage reports to Codecov
if: matrix.test
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.package }}
files: ${{ matrix.path }}/${{ matrix.package }}/coverage/lcov.info