MotorSignal-App/.github/actions/flutter-ci-setup/action.yml

37 lines
985 B
YAML

name: Flutter CI setup
description: Set up Flutter dependencies and restore build_runner state for CI jobs.
inputs:
setup-java:
description: Whether this job needs the pinned Java toolchain.
required: false
default: 'false'
build-runner-cache-key:
description: Cache key for build_runner state.
required: true
runs:
using: composite
steps:
- name: Set up Java
if: inputs.setup-java == 'true'
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
cache: gradle
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
cache: true
- name: Get dependencies
shell: bash
run: flutter pub get
- name: Restore build_runner state
uses: actions/cache@v4
with:
path: .dart_tool/build
key: ${{ inputs.build-runner-cache-key }}