59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
# CI pipeline for git.kellsupport.com/mtkell/glp-companion
|
|
#
|
|
# Runs on Forgejo Actions (GitHub Actions-compatible syntax; also usable as a
|
|
# reference for Woodpecker pipelines). Every job executes inside the standard
|
|
# Flutter container so the runner only needs Docker.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: Analyze, test & build
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/cirruslabs/flutter:stable
|
|
|
|
steps:
|
|
# 1. Checkout the repository at the triggering ref.
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
# 2. Dummy runtime configuration: `pubspec.yaml` bundles `.env` as an
|
|
# asset, so builds fail without it. The values below are inert
|
|
# placeholders — real credentials live in runner secrets / .env.local.
|
|
- name: Create mock .env
|
|
run: |
|
|
cat > .env <<'EOF'
|
|
SUPABASE_URL=https://placeholder.supabase.co
|
|
SUPABASE_PUBLISHABLE_KEY=sb_publishable_ci_placeholder
|
|
EOF
|
|
|
|
# 3. Resolve Dart/Flutter dependencies.
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
# 4. Regenerate drift table classes (app_database.g.dart) so schema
|
|
# changes are validated against the checked-in output.
|
|
- name: Run drift code generator
|
|
run: dart run build_runner build --delete-conflicting-outputs
|
|
|
|
# 5. Static analysis with infos treated as failures.
|
|
- name: Static analysis
|
|
run: flutter analyze --fatal-infos
|
|
|
|
# 6. Unit, widget, and integration suites with coverage instrumentation.
|
|
- name: Run test suite
|
|
run: flutter test --coverage
|
|
|
|
# 7. Build validation across responsive form factors: the asset bundle
|
|
# (all native targets) and the web release (Wasm/CanvasKit).
|
|
- name: Build sanity - asset bundle
|
|
run: flutter build bundle
|
|
|
|
- name: Build sanity - web
|
|
run: flutter build web --no-tree-shake-icons
|