Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIthub actions - code coverage #229

Merged
merged 17 commits into from
Apr 3, 2021
21 changes: 20 additions & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- master
- develop
- github-action
pull_request:
branches:
- master
Expand Down Expand Up @@ -158,3 +157,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
20 changes: 0 additions & 20 deletions chopper/coverage_badge.svg

This file was deleted.

5 changes: 0 additions & 5 deletions chopper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ dev_dependencies:
build_runner: ^1.12.1
build_test: ^2.0.0
coverage: ^1.0.2
# wait https://github.com/pulyaevskiy/test-coverage/pull/39
# test_coverage:
# git:
# url: https://github.com/JEuler/test-coverage.git
# ref: new-coverage
http_parser: ^4.0.0
pedantic: ^1.11.0
chopper_generator:
Expand Down
16 changes: 15 additions & 1 deletion mono_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions tool/coverage.sh
Original file line number Diff line number Diff line change
@@ -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