diff --git a/.github/workflows/pull_request_validation.yml b/.github/workflows/pull_request_validation.yml index bca1805..d7ed896 100644 --- a/.github/workflows/pull_request_validation.yml +++ b/.github/workflows/pull_request_validation.yml @@ -1,19 +1,42 @@ -# This workflow builds, analyses and tests every pull request. +# This workflow builds, analyzes, and tests every pull request. name: Pull Request Validation -on: pull_request +on: + push: + branches: + - develop + - main + - master + + pull_request: + jobs: analyze-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-java@v1 + - name: ๐Ÿ“š Git Checkout + uses: actions/checkout@v4 + + - name: ๐Ÿฆ Setup Flutter + uses: subosito/flutter-action@v2 with: - java-version: "12.x" - - uses: subosito/flutter-action@v1 - with: - channel: "stable" - - run: flutter pub get - - run: flutter pub run build_runner build --delete-conflicting-outputs - - run: flutter build apk --release --flavor production -t lib/main_production.dart - - run: flutter analyze - - run: flutter test + channel: 'stable' + cache: true + cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} + + - name: ๐Ÿ“ฆ Install Dependencies + run: flutter pub get + + - name: ๐Ÿ› ๏ธ Build Runner (Generate Code) + run: flutter pub run build_runner build --delete-conflicting-outputs + + - name: ๐Ÿ•ต๏ธ Analyze Code + run: flutter analyze lib test + + - name: โœจ Check Formatting + run: dart format --line-length 80 --set-exit-if-changed lib test + + - name: ๐Ÿ—๏ธ Build APK (Production Flavor) + run: flutter build apk --release --flavor production -t lib/main_production.dart + + - name: ๐Ÿงช Run Tests + run: flutter test