diff --git a/.github/workflows/dart_ci.yml b/.github/workflows/dart_ci.yml index f81db64a..f39be8ce 100644 --- a/.github/workflows/dart_ci.yml +++ b/.github/workflows/dart_ci.yml @@ -10,22 +10,46 @@ on: - '**' jobs: + # Run as a separate job outside the Dart SDK matrix below, + # since we can only emit a single SBOM. + create-sbom-release-asset: + name: Create SBOM Release Asset + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + with: + sdk: 2.19.6 # This version doesn't matter so long as it resolves. + - run: dart pub get + - name: Publish SBOM to Release Assets + uses: anchore/sbom-action@v0 + with: + path: ./ + format: cyclonedx-json + build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - # Can't run on `stable` (Dart 3) until we're fully null-safe. - sdk: [2.19.6] + sdk: [2.19.6, stable] steps: - uses: actions/checkout@v2 - - uses: dart-lang/setup-dart@v1 + - id: setup-dart + uses: dart-lang/setup-dart@v1 with: sdk: ${{ matrix.sdk }} - name: Print Dart SDK version run: dart --version + - name: Delete Dart-2-only files when running on Dart 3 + run: | + DART_VERSION="${{ steps.setup-dart.outputs.dart-version }}" + if [[ "$DART_VERSION" =~ ^3 ]]; then + ./tool/delete_dart_2_only_files.sh + fi + - id: install name: Install dependencies run: dart pub get @@ -46,14 +70,10 @@ jobs: run: | dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc if: always() && steps.install.outcome == 'success' - timeout-minutes: 5 + timeout-minutes: 8 - name: Run tests (dart2js) run: | dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js if: always() && steps.install.outcome == 'success' - timeout-minutes: 5 - - uses: anchore/sbom-action@v0 - with: - path: ./ - format: cyclonedx-json + timeout-minutes: 8 \ No newline at end of file diff --git a/dart_test.yaml b/dart_test.yaml index d5effb76..62b2c40f 100644 --- a/dart_test.yaml +++ b/dart_test.yaml @@ -4,6 +4,9 @@ platforms: - chrome - vm +# Work around process handing after tests finish: https://github.com/dart-lang/build/issues/3765 +concurrency: 1 + presets: dart2js-legacy: exclude_tags: no-dart2js diff --git a/pubspec.yaml b/pubspec.yaml index 0dd5dcae..616aa494 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ version: 7.2.0 description: Bindings of the ReactJS library for building interactive interfaces. homepage: https://github.com/cleandart/react-dart environment: - sdk: '>=2.13.0 <3.0.0' + sdk: '>=2.13.0 <4.0.0' dependencies: js: ^0.6.3 meta: ^1.6.0 diff --git a/tool/delete_dart_2_only_files.sh b/tool/delete_dart_2_only_files.sh new file mode 100755 index 00000000..299f8ac1 --- /dev/null +++ b/tool/delete_dart_2_only_files.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# +# This script deletes files that can only be run in Dart 2 (ones not using null-safety), +# and need to be deleted for analysis and compilation to work in Dart 3. +# + +set -e + +rm test/nullable_callback_detection/non_null_safe_refs.dart +rm test/nullable_callback_detection/nullable_callback_detection_unsound_test.dart \ No newline at end of file