Shuffle/.forgejo/workflows/ci.yml
cschlaefke 317634dac5
Some checks are pending
CI / flutter (push) Waiting to run
CI / supabase (push) Waiting to run
CI / supabase-tests (push) Waiting to run
chore: initial project kit
2026-11-02 12:14:09 +01:00

76 lines
2.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CI für Pull Requests und main – läuft auf einem Forgejo-Runner mit Docker-Label
name: CI
on:
pull_request:
push:
branches: [main]
jobs:
flutter:
runs-on: docker
container:
image: ghcr.io/cirruslabs/flutter:stable # für Releases auf feste Version pinnen
defaults:
run:
working-directory: app
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- name: Pub-Cache
uses: https://code.forgejo.org/actions/cache@v4
with:
path: /root/.pub-cache
key: pub-${{ hashFiles('app/pubspec.lock') }}
- name: Abhängigkeiten
run: flutter pub get
- name: Code-Generierung
run: dart run build_runner build --delete-conflicting-outputs
- name: Format
run: dart format --set-exit-if-changed lib test
- name: Analyse
run: flutter analyze --fatal-infos
- name: Tests
run: flutter test --coverage
- name: Web-Build
run: flutter build web --release --dart-define-from-file=env/ci.example.json
supabase:
runs-on: docker
container:
image: node:22-bookworm
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- name: Migrationen prüfen (ohne laufende DB)
run: |
test -d supabase/migrations || { echo "Keine Migrationen – übersprungen"; exit 0; }
# Bereits gemergte Migrationen dürfen nicht verändert werden
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch origin "${{ github.base_ref }}" --depth=1
changed=$(git diff --name-only --diff-filter=M "origin/${{ github.base_ref }}"...HEAD -- supabase/migrations || true)
if [ -n "$changed" ]; then echo "Geänderte bestehende Migrationen: $changed"; exit 1; fi
fi
# RLS-/pgTAP-Tests: braucht einen Runner mit Docker-Socket (Label "docker-host").
# Läuft nur, wenn Migrationen existieren. Ohne passenden Runner Job bei Bedarf deaktivieren.
supabase-tests:
runs-on: docker-host
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-node@v4
with:
node-version: 22
- name: Supabase starten und Datenbanktests ausführen
run: |
test -d supabase/migrations || { echo "Keine Migrationen – übersprungen"; exit 0; }
npx --yes supabase start -x studio,imgproxy,edge-runtime,logflare,vector
npx --yes supabase test db
- name: Aufräumen
if: always()
run: npx --yes supabase stop --no-backup || true