Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Add comprehensive mobile packages linter workflow

Neeraj Gupta800d99f08b2e
diff --git a/.github/workflows/auth-lint.yml b/.github/workflows/auth-lint.yml
index df54a52038..4e3b0abb6e 100644
--- a/.github/workflows/auth-lint.yml
+++ b/.github/workflows/auth-lint.yml
@@ -1,11 +1,10 @@
name: "Lint (auth)"
on:
- # Run on every pull request (open or push to it) that changes auth/
+ # Run on every pull request (open or push to it) that changes auth app
pull_request:
paths:
- "mobile/apps/auth/**"
- - "mobile/packages/**"
- ".github/workflows/auth-lint.yml"
env:
diff --git a/.github/workflows/locker-lint.yml b/.github/workflows/locker-lint.yml
index 2861d1e2ba..1a97cbe2f7 100644
--- a/.github/workflows/locker-lint.yml
+++ b/.github/workflows/locker-lint.yml
@@ -1,11 +1,10 @@
name: "Lint (locker)"
on:
- # Run on every pull request (open or push to it) that changes locker/
+ # Run on every pull request (open or push to it) that changes locker app
pull_request:
paths:
- "mobile/apps/locker/**"
- - "mobile/packages/**"
- ".github/workflows/locker-lint.yml"
env:
diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml
index 4651f0ec52..a49d475d8f 100644
--- a/.github/workflows/mobile-lint.yml
+++ b/.github/workflows/mobile-lint.yml
@@ -1,11 +1,10 @@
name: "Lint (mobile)"
on:
- # Run on every pull request (open or push to it) that changes mobile/
+ # Run on every pull request (open or push to it) that changes photos app or rust core
pull_request:
paths:
- "mobile/apps/photos/**"
- - "mobile/packages/**"
- "rust/core/**"
- ".github/workflows/mobile-lint.yml"
diff --git a/.github/workflows/mobile-packages-lint.yml b/.github/workflows/mobile-packages-lint.yml
new file mode 100644
index 0000000000..2c59f9faea
--- /dev/null
+++ b/.github/workflows/mobile-packages-lint.yml
@@ -0,0 +1,177 @@
+name: "Lint (mobile packages)"
+
+on:
+ # Run when mobile/packages changes
+ pull_request:
+ paths:
+ - "mobile/packages/**"
+ - ".github/workflows/mobile-packages-lint.yml"
+
+env:
+ FLUTTER_VERSION: "3.32.8"
+ RUSTFLAGS: -D warnings
+
+permissions:
+ contents: read
+
+jobs:
+ packages-lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code and submodules
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: Install Flutter ${{ env.FLUTTER_VERSION }}
+ uses: subosito/flutter-action@v2
+ with:
+ channel: "stable"
+ flutter-version: ${{ env.FLUTTER_VERSION }}
+ cache: true
+
+ - name: Cache Rust dependencies
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ mobile/packages/rust/rust/target
+ key: ${{ runner.os }}-cargo-packages-${{ hashFiles('mobile/packages/**/Cargo.lock') }}
+
+ - name: Install Flutter Rust Bridge
+ run: cargo install flutter_rust_bridge_codegen
+
+ - name: Generate Rust bindings (Core)
+ run: flutter_rust_bridge_codegen generate
+ working-directory: mobile/packages/rust
+
+ - name: Generate strings localizations
+ run: flutter gen-l10n
+ working-directory: mobile/packages/strings
+
+ # Lint all packages
+ - name: Lint package - accounts
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/accounts
+
+ - name: Lint package - base
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/base
+
+ - name: Lint package - configuration
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/configuration
+
+ - name: Lint package - dir_utils
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/dir_utils
+
+ - name: Lint package - ente_crypto_api
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/ente_crypto_api
+
+ - name: Lint package - ente_crypto_dart_adapter
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/ente_crypto_dart_adapter
+
+ - name: Lint package - ente_icons
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/ente_icons
+
+ - name: Lint package - ente_pure_utils
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/ente_pure_utils
+
+ - name: Lint package - events
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/events
+
+ - name: Lint package - legacy
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/legacy
+
+ - name: Lint package - lock_screen
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/lock_screen
+
+ - name: Lint package - log_viewer
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/log_viewer
+
+ - name: Lint package - logging
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/logging
+
+ - name: Lint package - native_video_editor
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/native_video_editor
+
+ - name: Lint package - network
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/network
+
+ - name: Lint package - qr
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/qr
+
+ - name: Lint package - sharing
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/sharing
+
+ - name: Lint package - strings
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/strings
+
+ - name: Lint package - ui
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/ui
+
+ - name: Lint package - utils
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/packages/utils
+
+ - name: Check formatting (ente_rust)
+ working-directory: mobile/packages/rust/rust
+ run: cargo fmt -- src/frb_generated.rs && cargo fmt --check
+
+ - name: Run clippy (ente_rust)
+ working-directory: mobile/packages/rust/rust
+ run: cargo clippy --all-targets --all-features
+
+ - name: Build (ente_rust)
+ working-directory: mobile/packages/rust/rust
+ run: cargo build
+
+ - name: Test (ente_rust)
+ working-directory: mobile/packages/rust/rust
+ run: cargo test
+
+ # Lint all three apps to ensure package changes don't break them
+ - name: Lint app - photos
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/apps/photos
+
+ - name: Check formatting (ente_photos_rust)
+ working-directory: mobile/apps/photos/rust
+ run: cargo fmt -- src/frb_generated.rs && cargo fmt --check
+
+ - name: Run clippy (ente_photos_rust)
+ working-directory: mobile/apps/photos/rust
+ run: cargo clippy --all-targets --all-features
+
+ - name: Build (ente_photos_rust)
+ working-directory: mobile/apps/photos/rust
+ run: cargo build
+
+ - name: Test (ente_photos_rust)
+ working-directory: mobile/apps/photos/rust
+ run: cargo test
+
+ - name: Lint app - auth
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/apps/auth
+
+ - name: Lint app - locker
+ run: flutter pub get && flutter analyze --no-fatal-infos
+ working-directory: mobile/apps/locker