mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-25 04:19:30 +00:00
Replace setup-env action with reusable flutter-setup workflow; streamline CI configuration and enhance dependency management
This commit is contained in:
parent
0d2db7778a
commit
d55ddc5b78
3 changed files with 74 additions and 44 deletions
49
.github/workflows/flutter-setup.yaml
vendored
Normal file
49
.github/workflows/flutter-setup.yaml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
name: 🛠️ Reusable Flutter Setup
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
flutter-channel:
|
||||
description: "Flutter channel to use (stable, beta, dev, master)"
|
||||
required: false
|
||||
type: string
|
||||
default: "stable"
|
||||
java-version:
|
||||
description: "Java version to set up"
|
||||
required: false
|
||||
type: string
|
||||
default: "17"
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup Flutter Environment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "temurin"
|
||||
# Use the input value, fallback to default if not provided
|
||||
java-version: ${{ inputs.java-version }}
|
||||
- name: Set up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: ${{ inputs.flutter-channel }}
|
||||
flutter-version-file: pubspec.yaml
|
||||
cache: true # Cache Flutter SDK itself
|
||||
- name: Cache Flutter dependencies
|
||||
id: cache-pub # Give the step an ID to potentially reference its outputs later if needed
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.FLUTTER_HOME }}/.pub-cache
|
||||
# Use a consistent key structure based on the lock file
|
||||
key: ${{ runner.os }}-flutter-pub-${{ hashFiles('**/pubspec.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-flutter-pub-
|
||||
|
||||
- name: Get Flutter dependencies
|
||||
run: flutter pub get
|
||||
Loading…
Add table
Add a link
Reference in a new issue