diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 948929aa..bfe02c10 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -5,7 +5,6 @@ on: branches: - master - develop - - github-action pull_request: branches: - master @@ -176,3 +175,23 @@ jobs: needs: - job_001 - job_002 + job_005: + name: Coverage + runs-on: ubuntu-latest + steps: + - uses: dart-lang/setup-dart@v1.0 + with: + sdk: stable + - id: checkout + uses: actions/checkout@v2 + - id: upload_coverage + name: chopper; tool/coverage.sh + if: "always() && steps.checkout.conclusion == 'success'" + run: bash tool/coverage.sh + env: + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" + needs: + - job_001 + - job_002 + - job_003 + - job_004 diff --git a/chopper/coverage_badge.svg b/chopper/coverage_badge.svg deleted file mode 100644 index 49b4e416..00000000 --- a/chopper/coverage_badge.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - coverage - coverage - 88% - 88% - - diff --git a/mono_repo.yaml b/mono_repo.yaml index 4da10b41..a7fafb4c 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -6,11 +6,25 @@ github: branches: - master - develop - - github-action pull_request: branches: - master - develop + on_completion: + - name: "Coverage" + runs-on: ubuntu-latest + steps: + - uses: dart-lang/setup-dart@v1.0 + with: + sdk: stable + - id: checkout + uses: actions/checkout@v2 + - id: upload_coverage + name: "chopper; tool/coverage.sh" + if: "always() && steps.checkout.conclusion == 'success'" + run: bash tool/coverage.sh + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} merge_stages: - analyzer_and_format diff --git a/tool/coverage.sh b/tool/coverage.sh new file mode 100755 index 00000000..8fb7f288 --- /dev/null +++ b/tool/coverage.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +dart pub get +dart run test --coverage=coverage +dart run coverage:format_coverage --lcov \ + --in=coverage \ + --out=coverage/coverage.lcov \ + --packages=.packages \ + --report-on=lib + +curl -s https://codecov.io/bash | bash \ No newline at end of file