Use custom_lint from hosted #177
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: | |
package: [hive, hive_flutter, hive_generator] | |
flutter-channel: [stable, beta] | |
defaults: | |
run: | |
working-directory: ${{ matrix.package }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.flutter-channel }} | |
- run: | | |
dart pub get | |
dart format . --set-exit-if-changed | |
dart analyze --fatal-infos | |
dart pub run 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 |