diff --git a/.gitignore b/.gitignore index 966f63a6..d10cc282 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # Python .venv/ scripts/__pycache__/ + +# VSCode +.vscode diff --git a/.template/.github/workflows/test.yml b/.template/.github/workflows/test.yml index fb5d998b..9d4da733 100644 --- a/.template/.github/workflows/test.yml +++ b/.template/.github/workflows/test.yml @@ -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 diff --git a/.template/README.md b/.template/README.md index 602645f7..306c7277 100644 --- a/.template/README.md +++ b/.template/README.md @@ -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 @@ -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, diff --git a/.template/codecov.yml b/.template/codecov.yml new file mode 100644 index 00000000..499056a0 --- /dev/null +++ b/.template/codecov.yml @@ -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"