Skip to content

Commit

Permalink
Compatibility with Dart v2 and v3, analyzer v5 and v6
Browse files Browse the repository at this point in the history
  • Loading branch information
evanweible-wf committed Oct 31, 2023
1 parent cc6dee2 commit f68e4fe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/dart_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [ stable, beta, dev ]
sdk: [ 2.19.6, stable, beta ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
Expand All @@ -32,24 +32,29 @@ jobs:
- name: Run tests
run: dart test

validate_analyzer:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [ stable ]
analyzer:
- ^5.0.0
# Uncomment once we're on Dart 2.19+
# - ^6.0.0
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Update analyzer constraint to ${{ matrix.analyzer }}
run: dart pub remove analyzer && dart pub add analyzer:${{ matrix.analyzer }} && git diff pubspec.yaml
- name: Analyze project source
run: dart analyze
- name: Run tests
run: dart test
# If new major versions of analyzer are released in the future and we want to
# be compatible with multiple majors, use this workflow to validate.
# NOTE: we're currently compatible with analyzer v5 and v6, but v5 is only
# compatible with Dart 2 and v6 is only compatible with Dart 3, so we are
# already testing both major versions above. Use this workflow below if we
# need to test compatibility across multiple analyzer majors all on Dart 3.
# validate_analyzer:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# sdk: [ stable ]
# analyzer:
# - ^6.0.0
# - ^7.0.0
# steps:
# - uses: actions/checkout@v4
# - uses: dart-lang/setup-dart@v1
# with:
# sdk: ${{ matrix.sdk }}
# - name: Update analyzer constraint to ${{ matrix.analyzer }}
# run: dart pub remove analyzer && dart pub add analyzer:${{ matrix.analyzer }} && git diff pubspec.yaml
# - name: Analyze project source
# run: dart analyze
# - name: Run tests
# run: dart test
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ description: >
towards updating and refactoring Dart code, but can modify any files.
environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=2.19.0 <4.0.0'

dependencies:
analyzer: ^6.3.0
analyzer: '>=5.13.0 <7.0.0'
args: ^2.0.0
glob: ^2.0.1
io: ^1.0.0
Expand Down

0 comments on commit f68e4fe

Please sign in to comment.