Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add coverage #7

Merged
merged 2 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: Dart

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
branches: [ "master" ]
branches: ['master']

jobs:
build:
Expand Down Expand Up @@ -40,3 +40,30 @@ jobs:
# want to change this to 'flutter test'.
- name: Run tests
run: dart test

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603

- name: Install dependencies
run: dart pub get

- name: Install coverage tools
run: dart pub global activate coverage

- name: Run coverage
run: dart pub global run coverage:test_with_coverage

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Dart](https://github.com/MatthiWare/mediator.dart/actions/workflows/dart.yml/badge.svg?branch=master)](https://github.com/MatthiWare/mediator.dart/actions/workflows/dart.yml)
[![pub package](https://img.shields.io/pub/v/dart_mediator.svg?label=dart_mediator&color=blue)](https://pub.dartlang.org/packages/dart_mediator)
[![codecov](https://codecov.io/gh/MatthiWare/mediator.dart/graph/badge.svg?token=W1WQDQEZIJ)](https://codecov.io/gh/MatthiWare/mediator.dart)

# Description

Expand Down