Update flutter_test.yml #1108
This file contains hidden or 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: Flutter Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| unit_tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java Development Kit | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" # Using JDK 17 for broader compatibility | |
| - name: Set up Flutter SDK | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: "stable" | |
| flutter-version: "3.38.3" # Use the latest stable Flutter version as of Dec 05 2025 | |
| cache: true # Enable caching for Flutter SDK itself | |
| # cache-key and cache-path are automatically handled by subosito/flutter-action when cache: true | |
| - name: Cache Flutter Pub dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ runner.tool_cache }}/flutter_plugin_cache # This is often included in ~/.pub-cache, but good to be explicit | |
| ~/.pub-cache | |
| key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter- | |
| - name: Clean Flutter project | |
| run: flutter clean | |
| - name: Display Flutter version | |
| run: flutter --version | |
| - name: Run Flutter Doctor | |
| run: flutter doctor -v | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| - name: Generate localization files | |
| run: flutter gen-l10n | |
| - name: Run Flutter tests | |
| run: flutter test --no-pub # Use --no-pub since pub get was already run/cached |