From 916ac4a664fdd35d2d6b709a085ec023beb0e088 Mon Sep 17 00:00:00 2001 From: Kosuke Saigusa Date: Wed, 3 Jan 2024 23:29:28 +0900 Subject: [PATCH] ci: add coverage options to ci test --- .github/workflows/build.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 164f840..7729be1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -67,8 +67,18 @@ jobs: - name: Run tests run: | if grep -q "name: example" "pubspec.yaml"; then - flutter test + flutter test --coverage else - dart test + dart test --coverage=./coverage + dart run coverage:format_coverage --lcov --in=./coverage --out=./coverage/lcov.info --report-on=lib fi working-directory: ${{ matrix.package }} + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + fail_ci_if_error: true + flags: unittests + name: codecov-umbrella