Skip to content

Commit 9c416fb

Browse files
committed
chore: add more tests case
1 parent 9a3f83c commit 9c416fb

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Dart Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Dart SDK
17+
uses: dart-lang/setup-dart@v1
18+
with:
19+
dart-version: stable
20+
21+
- name: Install dependencies
22+
run: dart pub get
23+
24+
- name: Run tests
25+
run: dart test --coverage
26+
27+
- name: Generate coverage report
28+
run: genhtml coverage/lcov.info -o coverage/html
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v3
32+
with:
33+
file: ./coverage/lcov.info
34+
flags: unittests
35+
name: codecov-umbrella
36+
fail_ci_if_error: true

pubspec.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ dev_dependencies:
2727
build_runner: ^2.4.8
2828
flutter_test:
2929
sdk: flutter
30+
flutter_lints: ^2.0.0
3031
json_serializable: ^6.7.1
3132
mocktail: ^1.0.3
33+
test_coverage: ^0.5.0
34+
coverage: ^1.6.2
35+
codecov: ^0.5.0
3236
very_good_analysis: ^7.0.0

0 commit comments

Comments
 (0)