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