Complete the code to specify the Flutter version in the GitHub Actions workflow.
uses: subosito/flutter-action@v1 with: flutter-version: [1]
The flutter-version key sets the Flutter SDK version for the workflow. Using 3.7.0 ensures compatibility with recent Flutter features.
Complete the code to run Flutter tests in the GitHub Actions workflow.
- name: Run Flutter tests
run: flutter [1]The flutter test command runs unit and widget tests in your Flutter project during CI.
Fix the error in the workflow step to build an APK for Android.
- name: Build APK
run: flutter [1] apk --releaseThe correct command to build an APK is flutter build apk --release. 'build' tells Flutter to compile the app.
Fill both blanks to set up caching for Flutter dependencies in GitHub Actions.
- name: Cache Flutter dependencies uses: actions/cache@v3 with: path: [1] key: ${{ runner.os }}-flutter-${{ hashFiles('[2]') }}
Caching ~/.pub-cache speeds up dependency installation. Using pubspec.lock in the key ensures cache updates when dependencies change.
Fill all three blanks to create a GitHub Actions job that checks out code, sets up Flutter, and runs tests.
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/[1]@v3
- uses: subosito/flutter-action@v1
with:
flutter-version: [2]
- name: Run tests
run: flutter [3]The actions/checkout action gets the code. Setting flutter-version to 3.7.0 installs Flutter. Running flutter test executes tests.