diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a45e8d0..35d1598 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,43 +1,69 @@ -name: Run analyze - -concurrency: - group: $-$ - cancel-in-progress: true +name: Analysis and checking on: push: - branches: main + branches: + - "main" + paths-ignore: + - "**/README.md" pull_request: - branches: main + branches: + - "main" + workflow_dispatch: jobs: - drive: + check: + name: 🏗 Code analysing and checking runs-on: ubuntu-latest + env: + JAVA_VERSION: "17" + FLUTTER_VERSION: "3.24.3" + steps: - - name: 📚 Git Checkout - uses: actions/checkout@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: ${{env.JAVA_VERSION}} - - name: 🐦 Setup Flutter - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@v2 with: + flutter-version: ${{env.FLUTTER_VERSION}} channel: "stable" - cache: true - cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} - - name: 📦 Install Dependencies - run: | - flutter packages get + - name: 📦 Package install + run: flutter pub get - - name: ✨ Check Formatting - run: dart format --line-length 80 --set-exit-if-changed lib test + - name: Download Google Play Services JSON + id: google_services + uses: timheuer/base64-to-file@v1.2 + with: + fileName: "google-services.json" + encodedString: ${{ secrets.GOOGLE_SERVICE_BASE64 }} - - name: 🏗️ Generate build_runner - run: dart run build_runner build -d + - name: Create google-services.json + run: | + cp "${{ steps.google_services.outputs.filePath }}" android/app/ - - name: 🌐 Generate Locale Keys - run: dart run easy_localization:generate -S assets/translations -O lib/src/l10n -o locale_keys.g.dart -f keys + - name: Download firebase_options.dart + id: firebase_options + uses: timheuer/base64-to-file@v1.2 + with: + fileName: "firebase_options.dart" + encodedString: ${{ secrets.FIREBASE_OPTION_DART }} + + - name: Create firebase_options.dart + run: | + cp "${{ steps.firebase_options.outputs.filePath }}" lib/ - - name: 🕵️ Analyze + - name: Create .env run: | - flutter analyze lib/src - dart run custom_lint + touch .env + echo "ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_APP_ID }}" >> .env + cat .env + + - name: 🔨 Run code generation + run: dart run build_runner build + + - name: ✅ Run flutter analyze + run: flutter analyze diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 48f5450..43a7491 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -30,6 +30,10 @@ + +