Skip to content

Commit

Permalink
fix: lock flutter version on ci & call melos command
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaudon committed May 23, 2024
1 parent 8ab5a28 commit 605cb3c
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 234 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: continuous-delivery

on:
workflow_dispatch:
workflow_dispatch

env:
FLUTTER_VERSION: 3.22.1

jobs:
continuous-delivery-android:
Expand All @@ -14,6 +17,10 @@ jobs:
uses: actions/checkout@v3
- name: 🐦 Install flutter
uses: subosito/flutter-action@v2
with:
cache: true
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: 💎 Install ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -32,11 +39,15 @@ jobs:
# uses: actions/checkout@v3
# - name: 🐦 Install flutter
# uses: subosito/flutter-action@v2
# with:
# cache: true
# channel: stable
# flutter-version: $${{ env.FLUTTER_VERSION }}
# - name: 💎 Install ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: '3.3'
# bundler-cache: true
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: '3.3'
# bundler-cache: true
# - run: bundle install
# - name: 🚀 Deploy Android development application
# run: bundle exec fastlane development
32 changes: 12 additions & 20 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,24 @@ on:
- app/**
- packages/**

env:
FLUTTER_VERSION: 3.22.1

jobs:
continuous-integration:
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
dsfr:
- 'packages/dsfr.dart/**'
fetch-depth: 0
- name: 🐦 Install flutter
uses: subosito/flutter-action@v2
- name: ✅ Check app (format, lint, tests)
run: |
cd app
dart format $(find . -name '*.dart' -not -name '*.g.dart') --set-exit-if-changed
flutter analyze --fatal-infos --fatal-warnings
flutter test --test-randomize-ordering-seed random
cd -
- name: ✅ Check dsfr (format, lint, tests)
if: steps.filter.outputs.dsfr == 'true'
run: |
cd packages/dsfr.dart
dart format $(find . -name '*.dart' -not -name '*.g.dart') --set-exit-if-changed
flutter analyze --fatal-infos --fatal-warnings
flutter test --test-randomize-ordering-seed random
cd -
with:
cache: true
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: dart pub global activate melos
- run: melos run format_check_diff
- run: melos run analyze_diff
- run: melos run test_diff
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ app.*.map.json

# Result of fastlane
**/fastlane/report.xml

# Example
**/example/pubspec.lock
4 changes: 2 additions & 2 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: "3.4.0"
flutter: ">=3.22.0"
dart: "3.4.1"
flutter: ">=3.22.1"
1 change: 1 addition & 0 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version: 0.1.0

environment:
sdk: 3.4.1
flutter: 3.22.1

dependencies:
flutter:
Expand Down
4 changes: 3 additions & 1 deletion app/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# melos_managed_dependency_overrides: agir_lints
# melos_managed_dependency_overrides: agir_lints,dsfr
dependency_overrides:
agir_lints:
path: ../packages/agir_lints
dsfr:
path: ../packages/dsfr.dart
2 changes: 1 addition & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ scripts:
format_check_diff:
run: melos exec --diff=origin/main...HEAD --include-dependents dart format $(find . -name '*.dart' -not -name '*.g.dart') --set-exit-if-changed
analyze_diff:
run: melos exec --diff=origin/main...HEAD --include-dependents flutter analyze .
run: melos exec --diff=origin/main...HEAD --include-dependents flutter analyze --fatal-infos --fatal-warnings
test_diff:
run: melos exec --diff=origin/main...HEAD --include-dependents flutter test --test-randomize-ordering-seed random
204 changes: 0 additions & 204 deletions packages/dsfr.dart/example/pubspec.lock

This file was deleted.

1 change: 1 addition & 0 deletions packages/dsfr.dart/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version: 1.0.0+1

environment:
sdk: 3.4.1
flutter: 3.22.1

dependencies:
cupertino_icons: ^1.0.8
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,4 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: "3.4.0"
dart: "3.4.1"

0 comments on commit 605cb3c

Please sign in to comment.