Skip to content

Add GitHub Actions workflow for Flutter debug build #1

Add GitHub Actions workflow for Flutter debug build

Add GitHub Actions workflow for Flutter debug build #1

Workflow file for this run

name: Android Build CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Cache Flutter dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-flutter-${{ hashFiles('myapp/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Install dependencies
run: flutter pub get
working-directory: myapp
- name: Analyze project source
run: flutter analyze
working-directory: myapp
- name: Run tests
run: flutter test
working-directory: myapp
- name: Build debug APK
run: flutter build apk --debug
working-directory: myapp
- name: Upload debug APK artifact
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: myapp/build/app/outputs/flutter-apk/app-debug.apk