diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-18 18:59:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-18 18:59:14 +0300 |
| commit | e89d039fa85cab00f34ee45e99b801f92c58ff3a (patch) | |
| tree | 6dced1760a2c0e44db0392c399f7c32595f06ee1 | |
| parent | 567cdef73eb4385d937ddd74a988e489890b3cc1 (diff) | |
Add Dockerfile.flutter-ci and update android.yml to use project image
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | .woodpecker/android.yml | 16 | ||||
| -rw-r--r-- | Dockerfile.flutter-ci | 45 |
2 files changed, 54 insertions, 7 deletions
diff --git a/.woodpecker/android.yml b/.woodpecker/android.yml index 5b0bfa1..c0e21db 100644 --- a/.woodpecker/android.yml +++ b/.woodpecker/android.yml @@ -7,9 +7,11 @@ # (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). +# codeberg.org/snonux/player/flutter-ci:<version> — project-owned image built +# from Dockerfile.flutter-ci, pinned to a specific Flutter SDK version. +# Build and push the image when upgrading Flutter (see Dockerfile.flutter-ci). +# Falls back to ghcr.io/cirruslabs/flutter:stable if the project image is not +# yet published. # # Cache volumes (Woodpecker named volumes): # flutter-pub-cache → /root/.pub-cache (Flutter pub package cache) @@ -20,10 +22,10 @@ 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 + # Project-owned Flutter CI image (see Dockerfile.flutter-ci). Falls back to + # ghcr.io/cirruslabs/flutter:stable until the project image is published. + # Pin to a specific Flutter version tag; update this line when upgrading. + image: codeberg.org/snonux/player/flutter-ci:3.32.0 volumes: # Persist downloaded pub packages between runs to avoid repeated fetches. # The pub cache is keyed by pubspec.lock; no explicit invalidation is needed. diff --git a/Dockerfile.flutter-ci b/Dockerfile.flutter-ci new file mode 100644 index 0000000..f768042 --- /dev/null +++ b/Dockerfile.flutter-ci @@ -0,0 +1,45 @@ +# Dockerfile.flutter-ci — Flutter SDK image for CI use. +# +# Built on top of the official Dart Docker image and installs a pinned Flutter +# SDK release. Used by .woodpecker/android.yml to run `flutter analyze` and +# `flutter test` without downloading the SDK on every CI run. +# +# To build and push (replace TAG with the Flutter SDK version, e.g. 3.32.0): +# +# docker build --build-arg FLUTTER_VERSION=3.32.0 \ +# -t codeberg.org/snonux/player/flutter-ci:3.32.0 \ +# -f Dockerfile.flutter-ci . +# docker push codeberg.org/snonux/player/flutter-ci:3.32.0 +# +# Update .woodpecker/android.yml to reference the new tag when upgrading. + +FROM dart:3.8-sdk AS flutter-ci + +ARG FLUTTER_VERSION=3.32.0 + +# Install system packages needed by flutter, git, and the Dart toolchain. +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash \ + curl \ + git \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# Download and install the Flutter SDK at the pinned version. +RUN git clone --depth 1 --branch "${FLUTTER_VERSION}" \ + https://github.com/flutter/flutter.git /opt/flutter + +ENV PATH="/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:${PATH}" +ENV FLUTTER_ROOT=/opt/flutter + +# Pre-warm the Flutter tool cache: downloads the Dart SDK embedded in Flutter, +# sets up the engine and tool, and configures the CLI for CI use. +RUN flutter config --no-analytics \ + && flutter precache --no-android --no-ios --no-linux --no-macos --no-web \ + && flutter doctor --suppress-analytics + +# Pub cache lives here; mount as a Woodpecker named volume to persist across runs. +ENV PUB_CACHE=/root/.pub-cache + +WORKDIR /workspace |
