Skip to content

Commit

Permalink
Merge pull request #90 from nimblehq/feature/21-setup-codecov
Browse files Browse the repository at this point in the history
[#21] Add codecov to the ci/cd pipeline of the project
  • Loading branch information
manh-t authored Jul 1, 2022
2 parents 0522f92 + d1e8813 commit 33cd747
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# Python
.venv/
scripts/__pycache__/

# VSCode
.vscode
9 changes: 9 additions & 0 deletions .template/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ jobs:

- name: Run widget tests, unit tests.
run: flutter test --machine --coverage

- uses: codecov/codecov-action@v2
with:
name: Upload coverage to codecov
files: ./coverage/lcov.info
flags: unittests # optional
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: false
verbose: true
6 changes: 6 additions & 0 deletions .template/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Flutter Templates

[![codecov](https://codecov.io/gh/nimblehq/flutter_templates/branch/main/graph/badge.svg?token=ATUNXDX218)](https://codecov.io/gh/nimblehq/flutter_templates)

All the templates that can be used to kick off a new Flutter application quickly.

## Usage
Expand Down Expand Up @@ -50,6 +52,10 @@ Clone the repository

`$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/my_home_page_test.dart --flavor staging`

- Code coverage integration:

- CodeCov: for the private repository, we need to set up a [TeamBot](https://docs.codecov.com/docs/team-bot) in `codecov.yml`.

## License

This project is Copyright (c) 2014 and onwards. It is free software,
Expand Down
26 changes: 26 additions & 0 deletions .template/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Sample CodeCov config for private repository
codecov:
bot: luongvo
require_ci_to_pass: yes

coverage:
status:
project: off
patch: off

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,files,tree"
behavior: default
require_changes: no

ignore:
- "lib/di"
- "lib/gen"

0 comments on commit 33cd747

Please sign in to comment.