diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0bf257e..d39578f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,29 +26,8 @@ jobs: components: rustfmt, clippy - name: Test And Generate Coverage run: | - dart pub global activate full_coverage - mkdir -p coverage - - cd app - flutter pub get - dart pub global run full_coverage --ignore bridge_generated.dart,bridge_generated.io.dart,ffi.dart - flutter test --coverage - sed "s/^SF:.*lib/SF:app\/lib/g" coverage/lcov.info >> ../coverage/lcov.info - - cd .. - - cd packages - for d in */ ; do - cd $d - flutter pub get - dart pub global run full_coverage - flutter test --coverage - - escapedPath="$(echo packages/$d | sed 's/\//\\\//g')" - sed "s/^SF:.*lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> ../../coverage/lcov.info - rm -rf coverage - cd .. - done + cargo install just + just test - name: Upload Coverage uses: codecov/codecov-action@v3 with: diff --git a/justfile b/justfile index dcc4abcf..c92e6dd3 100644 --- a/justfile +++ b/justfile @@ -16,4 +16,26 @@ clean: cd app flutter clean cd native && cargo clean +test: + dart pub global activate full_coverage + rm -rf coverage + mkdir -p coverage + + cd app && flutter pub get + cd app && dart pub global run full_coverage --ignore bridge_generated.dart,bridge_generated.io.dart,ffi.dart + cd app && flutter test --coverage + cd app && sed "s/^SF:.*lib/SF:app\/lib/g" coverage/lcov.info >> ../coverage/lcov.info + + cd packages && for d in */ ; do \ + echo "Processing $d"; \ + cd $d; \ + flutter pub get; \ + dart pub global run full_coverage; \ + flutter test --coverage; \ + escapedPath="$(echo packages/$d | sed 's/\//\\\//g')"; \ + sed "s/^SF:.*lib/SF:${escapedPath}lib/g" coverage/lcov.info >> ../../coverage/lcov.info; \ + rm -rf coverage; \ + cd ..; \ + done + # vim:expandtab:sw=4:ts=4