Merge pull request #37 from IO-Design-Team/feature/hosted-custom-lint #183
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 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: | |
strategy: | |
matrix: | |
include: | |
- flutter-channel: stable | |
os: ubuntu-latest | |
- flutter-channel: stable | |
# Test on windows since the generator directly accesses the file system | |
os: windows-latest | |
- flutter-channel: beta | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
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: Run tests | |
run: dart test | |
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 | |
ensure-embedme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
npx embedme **/*.md | |
git diff --exit-code | |
check-score: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [hive, hive_flutter, hive_generator] | |
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 |