summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.woodpecker/android.yml58
-rw-r--r--.woodpecker/nightly.yml76
2 files changed, 134 insertions, 0 deletions
diff --git a/.woodpecker/android.yml b/.woodpecker/android.yml
new file mode 100644
index 0000000..5b0bfa1
--- /dev/null
+++ b/.woodpecker/android.yml
@@ -0,0 +1,58 @@
+# Flutter Android CI pipeline for codeberg.org/snonux/player
+#
+# Stage 1 — android-unit (every push touching player-android/**):
+# Fast gate: flutter analyze && flutter test
+# Path-scoped so that Go-only changes do not trigger the Flutter runner.
+# No emulator, no KVM required — unit tests run entirely in the Flutter SDK.
+# (Emulator decision deferred per docs/ci-design.md § 4.)
+#
+# Docker image:
+# ghcr.io/cirruslabs/flutter:stable — pre-built Flutter SDK image maintained by
+# CirrusLabs; eliminates ~500 MB SDK download on every run.
+# Update the tag when bumping Flutter locally (one-line change in this file).
+#
+# Cache volumes (Woodpecker named volumes):
+# flutter-pub-cache → /root/.pub-cache (Flutter pub package cache)
+# With a warm pub cache, `flutter pub get` runs in under 5 s.
+
+---
+# ── Stage 1: android-unit (every push touching player-android/**) ──────────────
+
+steps:
+ - name: android-unit
+ # ghcr.io/cirruslabs/flutter:stable bundles the Flutter SDK and Dart SDK so no
+ # SDK download occurs at runtime. Use a version-pinned tag in production when
+ # Flutter SDK version stability is required (see docs/ci-design.md § 8).
+ image: ghcr.io/cirruslabs/flutter:stable
+ volumes:
+ # Persist downloaded pub packages between runs to avoid repeated fetches.
+ # The pub cache is keyed by pubspec.lock; no explicit invalidation is needed.
+ - flutter-pub-cache:/root/.pub-cache
+ directory: player-android
+ commands:
+ # Analyse the Flutter project for type errors, lints, and deprecations.
+ # This is a fast static check that catches most issues without running code.
+ - flutter analyze
+
+ # Run all unit tests under player-android/test/.
+ # No emulator is needed — flutter test runs on the host Dart VM.
+ # -count=1 is not a Flutter flag; flutter test always runs fresh.
+ - flutter test
+
+ # Trigger only on pushes or pull requests that touch the Flutter sub-project.
+ # Path filtering prevents Go-only commits from queueing a Flutter runner.
+ when:
+ - event: [push, pull_request]
+ path:
+ include:
+ - player-android/**
+
+# ── Volumes declaration ────────────────────────────────────────────────────────
+# Named volumes are created once per Woodpecker agent host and reused across
+# pipeline runs. They are not automatically cleaned up — run a periodic purge
+# if disk usage becomes a concern (see docs/ci-design.md § 6).
+
+volumes:
+ - name: flutter-pub-cache
+ host:
+ path: /var/woodpecker/cache/flutter-pub-cache
diff --git a/.woodpecker/nightly.yml b/.woodpecker/nightly.yml
new file mode 100644
index 0000000..3f3fb24
--- /dev/null
+++ b/.woodpecker/nightly.yml
@@ -0,0 +1,76 @@
+# Nightly LLM e2e pipeline for codeberg.org/snonux/player
+#
+# Trigger: Woodpecker cron schedule 0 2 * * * (02:00 UTC daily, main only).
+# Manual dispatch is also allowed for ad-hoc runs.
+#
+# Purpose: LLM-assisted end-to-end test harness (currently a placeholder).
+# The real test suite is a future task. This pipeline wires in the correct
+# structure — secret injection, branch guard, cost logging — so that the
+# first real LLM e2e tests can be added without restructuring the YAML.
+#
+# Secrets:
+# ANTHROPIC_API_KEY — injected from a Woodpecker protected project secret.
+# "Protected" mode prevents the key from being exposed in fork PRs.
+# Additionally, the pipeline itself checks CI_COMMIT_BRANCH == "main" as a
+# belt-and-suspenders guard (see docs/ci-design.md § 5).
+#
+# Cost logging:
+# The cost-log step emits a parseable summary line. When real LLM tests run,
+# update the placeholder with actual token/cost values from the test harness.
+# A future monitoring step can fail the job if cost exceeds a threshold.
+
+---
+# ── Nightly LLM e2e (main only, cron 0 2 * * *) ───────────────────────────────
+
+steps:
+ - name: llm-e2e
+ # Use a minimal Alpine image — no Flutter or Go SDK needed for the stub.
+ # Replace with an appropriate image when real LLM e2e tests are added.
+ image: alpine:3.21
+ secrets:
+ # ANTHROPIC_API_KEY is stored as a protected Woodpecker project secret.
+ # It is injected here but not yet consumed — the harness is a future task.
+ # Protected secrets are only available on the repo's own main branch, not
+ # on pull requests from forks.
+ - from_secret: ANTHROPIC_API_KEY
+ commands:
+ # Belt-and-suspenders branch guard: skip if not running on main.
+ # The cron trigger is already scoped to main; this check guards against
+ # accidental manual triggers on feature branches exposing the secret.
+ - |
+ if [ "$CI_COMMIT_BRANCH" != "main" ]; then
+ echo "Skipping LLM e2e: not on main branch (branch=$CI_COMMIT_BRANCH)"
+ exit 0
+ fi
+
+ # Placeholder: exits 0 until the real LLM e2e harness is implemented.
+ # Replace this block with the actual test invocation in a future task.
+ - 'echo "LLM e2e harness: placeholder (no tests implemented yet)"'
+ - exit 0
+
+ # Run only on pushes to main (manual dispatch) and via the cron trigger.
+ # The cron event is automatically scoped to main by Woodpecker's scheduler.
+ when:
+ - event: [push, cron]
+ branch: main
+
+# ── Cost logging step ──────────────────────────────────────────────────────────
+
+ - name: cost-log
+ # Minimal image — only needs shell to echo the cost summary line.
+ image: alpine:3.21
+ depends_on:
+ - llm-e2e
+ commands:
+ # Emit a parseable cost summary line.
+ # Format: "Cost: $<amount> (<note>)"
+ # When the real harness runs, replace the placeholder values with actual
+ # token counts and cost computed by the test runner. A future monitoring
+ # step can parse this line and fail the job if cost exceeds a threshold
+ # (e.g., $1.00/run — see docs/ci-design.md § 8).
+ - 'echo "Cost: $0.00 (placeholder -- no LLM calls yet)"'
+
+ # Run whenever llm-e2e ran — same branch/event filter applies.
+ when:
+ - event: [push, cron]
+ branch: main