diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1fcccb2d3..b3ba25448 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,6 +40,7 @@ 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 1b67afb6e..364385087 100644 --- a/melos.yaml +++ b/melos.yaml @@ -57,7 +57,12 @@ scripts: melos run test:flutter test:vm: name: Dart VM tests - exec: dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --coverage=coverage/vm --chain-stack-traces + exec: | + COVERAGE_PATH="coverage/vm" + if ["$COVERAGE_ENABLED" != "1"]; then + COVERAGE_PATH="" + fi + dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --coverage=$COVERAGE_PATH --chain-stack-traces packageFilters: flutter: false dirExists: test @@ -81,7 +86,12 @@ scripts: TEST_PLATFORM: firefox test:web:single: name: Dart Web tests in a browser - exec: dart test --platform ${TEST_PLATFORM} --coverage=coverage/${TEST_PLATFORM} --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces + exec: | + COVERAGE_PATH="coverage/${TEST_PLATFORM}" + if ["$COVERAGE_ENABLED" != "1"]; then + COVERAGE_PATH="" + 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