Merge pull request #3 from IliaKhuzhakhmetov/refator #24
This file contains 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 for Android | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Flutter and Gradle dependencies | |
uses: actions/cache@v2 | |
with: | |
# Cache the Flutter and Gradle dependencies directories | |
path: | | |
~/.gradle/caches/ | |
~/.gradle/wrapper/ | |
~/sdks/flutter/.pub-cache/ | |
# Use a unique cache key based on the workflow and SDK versions | |
key: ${{ runner.os }}-flutter-gradle-${{ hashFiles('**/*.dart') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/*.properties') }}-${{ hashFiles('**/*.yaml') }} | |
# Cache hit files are restored to their original location | |
restore-keys: ${{ runner.os }}-flutter-gradle- | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Setup Flutter SDK | |
uses: flutter-actions/setup-flutter@v2 | |
with: | |
channel: stable | |
version: 3.7.2 | |
# Use the cached Flutter dependencies | |
flutter-cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Generate classes | |
run: flutter pub run build_runner build --delete-conflicting-outputs | |
- name: Analyze project source | |
run: dart analyze |