Skip to content

Update dart.yml

Update dart.yml #4

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Flutter CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Force checkout to pull the absolute latest commit on the branch
ref: ${{ github.ref }}
# Ensure full history is pulled (good practice for CI, though may not be necessary here)
fetch-depth: 0
# 1. CHANGED: Use the Flutter-specific action
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or 'beta' or 'dev' if needed
# 2. CHANGED: Install dependencies using flutter pub get
- name: Install dependencies
run: flutter pub get
# Optional: Check code formatting (recommended)
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
# Check for common programming errors and style issues (recommended)
- name: Analyze project source
run: dart analyze
# 3. CHANGED: Run tests using flutter test
# This step requires you to have tests written in your 'test/' folder.
- name: Run tests
run: flutter test
# Optional: Build the APK or Web App (add this if you want to verify a full build)
- name: Build APK (Android)
run: flutter build apk --release