From b7c52c550afd087a4bd1439e505c4dca9ec8928c Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Wed, 12 Aug 2020 10:56:44 +0200 Subject: [PATCH] add test coverage ci with codecov --- .github/workflows/coverage.yml | 20 ++++++++++++++++++++ _tool/test-coverage.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/coverage.yml create mode 100755 _tool/test-coverage.sh diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..ad02d59 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,20 @@ +name: Coverage + +on: [push] + +jobs: + build: + strategy: + matrix: + os: ['ubuntu-latest'] + dart_channel: ['stable'] + + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + - uses: cedx/setup-dart@v2 + with: + release-channel: ${{ matrix.dart_channel }} + - run: _tool/test-coverage.sh diff --git a/_tool/test-coverage.sh b/_tool/test-coverage.sh new file mode 100755 index 0000000..9bbe421 --- /dev/null +++ b/_tool/test-coverage.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -xeu + +cd "${0%/*}"/.. + + +pub get +pub global activate test_coverage + +fail=false +pub global run test_coverage || fail=true +echo "fail=$fail" +bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info + +test "$fail" == "true" && exit 1 + +echo "Success 🎉️" + +exit 0 \ No newline at end of file