Skip to content

Commit

Permalink
Start running CI on Dart 3
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Oct 10, 2024
1 parent 0c6b206 commit 4b7627b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/dart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ jobs:
strategy:
fail-fast: false
matrix:
# Can't run on `dev` (Dart 3) until we're fully null-safe.
sdk: [ 2.19.6 ]
sdk: [ 2.19.6, 3.4.4, main ]
steps:
- uses: actions/checkout@v4
- 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
Expand Down Expand Up @@ -102,21 +109,28 @@ jobs:
strategy:
fail-fast: false
matrix:
# Can't run on `dev` (Dart 3) until we're fully null-safe.
sdk: [ 2.19.6 ]
sdk: [ 2.19.6, 3.4.4, main ]
analyzer:
# We only have one version currently, but we'll leave this CI step in place
# for the next time we need to support multiple analyzer versions.
- ^5.1.0
steps:
- uses: actions/checkout@v4
- 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
- name: Update analyzer constraint to ${{ matrix.analyzer }} and validate `dart pub get` can resolve
id: resolve
run: |
Expand All @@ -142,17 +156,24 @@ jobs:
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, 3.4.4, main ]
steps:
- uses: actions/checkout@v4
- 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
(cd ../.. && ./tool/delete_dart_2_only_files.sh)
fi
- id: link
name: Override over_react dependency with local path
run: cd ../.. && dart pub get && dart tool/travis_link_plugin_deps.dart
Expand Down
17 changes: 17 additions & 0 deletions tool/delete_dart_2_only_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/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 -rf test/over_react/component_declaration/non_null_safe_builder_integration_tests
rm test/over_react/component_declaration/flux_component_test/component2/unsound_flux_component_test.dart
rm test/over_react/component_declaration/flux_component_test/unsound_flux_component_test.dart
rm test/over_react_component_declaration_non_null_safe_test.dart

rm -rf tools/analyzer_plugin/test/unit/util/non_null_safe
rm -rf tools/analyzer_plugin/test/integration/assists/non_null_safe
rm -rf tools/analyzer_plugin/test/integration/diagnostics/non_null_safe

0 comments on commit 4b7627b

Please sign in to comment.