diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3ba25448..1fcccb2d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,6 @@ jobs: flutter-version: ${{ matrix.sdk == 'min' && '3.3.0' || '' }} channel: ${{ matrix.sdk == 'min' && '' || matrix.channel }} - run: | - echo COVERAGE_ENABLED=${{ matrix.sdk == 'stable' && '1' || '' }} >> $GITHUB_ENV echo TARGET_DART_SDK=${{ matrix.sdk }} >> $GITHUB_ENV - name: Prepare dependencies for the project management run: dart pub get diff --git a/melos.yaml b/melos.yaml index 364385087..52b6bd711 100644 --- a/melos.yaml +++ b/melos.yaml @@ -58,11 +58,14 @@ scripts: test:vm: name: Dart VM tests exec: | - COVERAGE_PATH="coverage/vm" - if ["$COVERAGE_ENABLED" != "1"]; then - COVERAGE_PATH="" + if ["$TARGET_DART_SDK" == "stable"]; then + dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} \ + --coverage=coverage/vm \ + --chain-stack-traces + else + dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} \ + --chain-stack-traces fi - dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --coverage=$COVERAGE_PATH --chain-stack-traces packageFilters: flutter: false dirExists: test @@ -87,11 +90,16 @@ scripts: test:web:single: name: Dart Web tests in a browser exec: | - COVERAGE_PATH="coverage/${TEST_PLATFORM}" - if ["$COVERAGE_ENABLED" != "1"]; then - COVERAGE_PATH="" + if ["$TARGET_DART_SDK" == "stable"]; then + dart test --platform ${TEST_PLATFORM} \ + --coverage="coverage/${TEST_PLATFORM}" \ + --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} \ + --chain-stack-traces + else + dart test --platform ${TEST_PLATFORM} \ + --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} \ + --chain-stack-traces fi - dart test --platform ${TEST_PLATFORM} --coverage=$COVERAGE_PATH --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces packageFilters: flutter: false dirExists: test