Skip to content

Commit 16c2971

Browse files
author
Peter Bryant
committed
👷 Setup code coverage
1 parent e111df7 commit 16c2971

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.github/workflows/main.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
- name: Setup Dart
1212
uses: dart-lang/setup-dart@v1
1313

14+
- name: Activate coverage package
15+
run: dart pub global activate coverage
16+
1417
- name: Install dependencies
1518
run: dart pub get
1619

@@ -24,4 +27,12 @@ jobs:
2427
run: dart pub run import_sorter:main --exit-if-changed
2528

2629
- name: Run tests
27-
run: dart test --test-randomize-ordering-seed random
30+
run: dart test --test-randomize-ordering-seed random --coverage="coverage"
31+
32+
- name: Generate coverage report
33+
run: format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib
34+
35+
- name: Coveralls
36+
uses: coverallsapp/github-action@master
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
.dart_tool/
33
.packages
44

5+
# Coverage files
6+
coverage/
7+
58
# Omit commiting pubspec.lock for library packages:
69
# https://dart.dev/guides/libraries/private-files#pubspeclock
710
pubspec.lock

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Easily authenticate using OAuth 2.0 client/password grants.
77
[![Pub Version](https://img.shields.io/pub/v/passputter)](https://pub.dev/packages/passputter)
88
![GitHub](https://img.shields.io/github/license/netsells/passputter)
99
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/netsells/passputter/Test)
10+
[![Coverage Status](https://coveralls.io/repos/github/netsells/passputter/badge.svg?branch=master)](https://coveralls.io/github/netsells/passputter?branch=master)
1011

1112
## 🚀 Installation
1213

0 commit comments

Comments
 (0)