Add generator support for GenerateAdapters
annotation
#136
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dart CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
flutter-channel: [stable, beta] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.flutter-channel }} | |
# TODO: Use custom_lint from hosted when https://github.com/invertase/dart_custom_lint/pull/272 lands | |
- run: | | |
dart pub global activate puby | |
dart pub global activate -sgit https://github.com/Rexios80/dart_custom_lint --git-ref f62fe2e1dc03162d1bb55dbba7e6b37bc08d81a1 --git-path packages/custom_lint | |
puby link | |
dart format . --set-exit-if-changed | |
dart analyze --fatal-infos | |
custom_lint | |
test-hive: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- test-platform: vm | |
compiler: kernel | |
- test-platform: chrome | |
compiler: dart2js | |
- test-platform: chrome | |
compiler: dart2wasm | |
defaults: | |
run: | |
working-directory: hive | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: browser-actions/setup-chrome@v1 | |
if: ${{ matrix.test-platform == 'chrome' }} | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: 3.4.0 | |
# rexios_lints requires a newer SDK | |
- name: Remove rexios_lints | |
run: | | |
sed -i '/rexios_lints:/d' pubspec.yaml | |
- name: Install dependencies | |
run: dart pub get --no-example | |
- name: Run tests | |
run: dart test -p ${{ matrix.test-platform }} -c ${{ matrix.compiler }} | |
test-hive-flutter: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
flutter-channel: [stable, beta] | |
defaults: | |
run: | |
working-directory: hive_flutter | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.flutter-channel }} | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run tests | |
run: flutter test | |
test-hive_generator: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
flutter-channel: [stable, beta] | |
defaults: | |
run: | |
working-directory: hive_generator | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.flutter-channel }} | |
- name: Install dependencies | |
run: dart pub get | |
- name: Generate build_runner output | |
run: dart pub run build_runner build --delete-conflicting-outputs | |
ensure-codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
- run: | | |
dart pub global activate puby | |
puby link | |
puby gen | |
git diff --exit-code | |
check-score: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [hive, hive_generator, hive_flutter] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
- run: | | |
cd ${{ matrix.package }} | |
flutter pub get | |
dart pub global activate pana | |
pana --no-warning --exit-code-threshold 0 |