Skip to content

Try adding the caching support for GH Actions #9

Try adding the caching support for GH Actions

Try adding the caching support for GH Actions #9

Workflow file for this run

name: Flutter CI
on: [push, pull_request]
jobs:
build-linux:
name: Build on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.pub-cache
build/linux
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Build Linux Release
run: flutter build linux --release
build-windows:
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.pub-cache
build/windows
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Build Windows Release
run: flutter build windows --release
build-android:
name: Build on Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.pub-cache
build/app/outputs/flutter-apk
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Build Android Release
run: flutter build apk --release