Skip to content

Commit f40ab36

Browse files
authored
Merge pull request #20 from FlutterGen/codecov
Add Codeov settings
2 parents be8b7dd + 9a4f984 commit f40ab36

File tree

8 files changed

+58
-1
lines changed

8 files changed

+58
-1
lines changed

.github/workflows/flutter-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
- name: Run tests for our flutter project.
6666
run: |
6767
make unit-test
68+
make coverage
6869
6970
- name: Build
7071
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,5 @@ node_modules/
108108

109109
## Test coverage
110110
coverage/
111+
test/
112+

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ run-example:
2626
unit-test:
2727
pub run test
2828

29+
coverage:
30+
pub run test_coverage --no-badge
31+
./scripts/codecov.sh ${CODECOV_TOKEN}
32+
2933
setup-ubuntu:
3034
sudo apt-get update
3135
sudo apt-get install apt-transport-https

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<a href="https://github.com/FlutterGen/flutter_gen/actions?query=workflow%3A%22Flutter+CI%22">
1111
<img src="https://github.com/FlutterGen/flutter_gen/workflows/Flutter%20CI/badge.svg?branch=master" />
1212
</a>
13+
<a href="https://codecov.io/gh/FlutterGen/flutter_gen">
14+
<img src="https://codecov.io/gh/FlutterGen/flutter_gen/branch/master/graph/badge.svg" />
15+
</a>
1316
</p>
1417

1518
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

codecov.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# https://docs.codecov.io/docs/commit-status
2+
codecov:
3+
notify:
4+
require_ci_to_pass: yes
5+
6+
coverage:
7+
status:
8+
project:
9+
default:
10+
# basic
11+
target: 0%
12+
threshold: 0%
13+
base: 0%
14+
# advanced
15+
branches: null
16+
if_no_uploads: error
17+
if_not_found: success
18+
if_ci_failed: error
19+
only_pulls: false
20+
flags: null
21+
paths: null
22+
23+
ignore:
24+
- "example/"
25+
- "**/*.gen.dart"

pubspec.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ packages:
112112
name: coverage
113113
url: "https://pub.dartlang.org"
114114
source: hosted
115-
version: "0.14.0"
115+
version: "0.13.11"
116116
crypto:
117117
dependency: transitive
118118
description:
@@ -204,6 +204,13 @@ packages:
204204
url: "https://pub.dartlang.org"
205205
source: hosted
206206
version: "3.0.1"
207+
lcov:
208+
dependency: transitive
209+
description:
210+
name: lcov
211+
url: "https://pub.dartlang.org"
212+
source: hosted
213+
version: "5.7.0"
207214
logging:
208215
dependency: transitive
209216
description:
@@ -407,6 +414,13 @@ packages:
407414
url: "https://pub.dartlang.org"
408415
source: hosted
409416
version: "0.3.11"
417+
test_coverage:
418+
dependency: "direct dev"
419+
description:
420+
name: test_coverage
421+
url: "https://pub.dartlang.org"
422+
source: hosted
423+
version: "0.4.3"
410424
time:
411425
dependency: transitive
412426
description:

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ dependencies:
2727

2828
dev_dependencies:
2929
test:
30+
test_coverage:
3031
pedantic:
3132
build_test:

scripts/codecov.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
TOKEN="${1}"
6+
export CODECOV_TOKEN=${TOKEN}
7+
bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)