fix(ci): add if: always() to build-android/build-ios so they run after continue-on-error lint/test
continue-on-error marks the job as failure, which skips downstream needs: jobs. The if: always() condition ensures build jobs run regardless of lint/test outcome.
This commit is contained in:
1 parent
3c4fd5fe21
commit
a512795064
2 files changed
+52
No files matched your search
@@ -0,0 +1,50 @@
|
|||||||
|
# CI-optimized image for kryz-go-flutter
|
||||||
|
# Build once on the runner host:
|
||||||
|
# docker build -f .devcontainer/ci.Dockerfile -t kryz-ci:latest .devcontainer
|
||||||
|
# Then all CI jobs use this image — no SDK downloads needed.
|
||||||
|
#
|
||||||
|
# First build: ~30 min (downloads Flutter + Android SDK)
|
||||||
|
# Subsequent builds: ~1 min (Docker layer caching)
|
||||||
|
# CI runtime without image: ~40 min (redownloads everything per job)
|
||||||
|
# CI runtime with image: ~2-5 min
|
||||||
|
|
||||||
|
FROM --platform=linux/amd64 debian:bookworm-slim
|
||||||
|
|
||||||
|
ARG FLUTTER_VERSION=3.44.0
|
||||||
|
|
||||||
|
ENV FLUTTER_HOME=/opt/flutter
|
||||||
|
ENV ANDROID_HOME=/opt/android-sdk
|
||||||
|
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||||
|
ENV PATH="${FLUTTER_HOME}/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${JAVA_HOME}/bin:${PATH}"
|
||||||
|
|
||||||
|
# ── Layer 1: system dependencies ──────────────────────────────────
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
wget curl unzip git xz-utils zip python3 libgtk-3-dev ninja-build \
|
||||||
|
openjdk-17-jre-headless \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# ── Layer 2: Flutter SDK (tarball, not git clone) ─────────────────
|
||||||
|
RUN wget -q "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
||||||
|
-O /tmp/flutter.tar.xz \
|
||||||
|
&& tar -xf /tmp/flutter.tar.xz -C /opt \
|
||||||
|
&& rm /tmp/flutter.tar.xz
|
||||||
|
|
||||||
|
# ── Layer 3: Android SDK ──────────────────────────────────────────
|
||||||
|
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
|
||||||
|
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdline-tools.zip \
|
||||||
|
&& unzip -q /tmp/cmdline-tools.zip -d ${ANDROID_HOME}/cmdline-tools \
|
||||||
|
&& mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \
|
||||||
|
&& rm /tmp/cmdline-tools.zip \
|
||||||
|
&& yes | sdkmanager --licenses \
|
||||||
|
&& sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
|
||||||
|
|
||||||
|
# ── Layer 4: Flutter precache (bakes platform artifacts into image) ──
|
||||||
|
RUN flutter precache --android
|
||||||
|
|
||||||
|
# ── Layer 5: non-root user ────────────────────────────────────────
|
||||||
|
RUN groupadd -g 1000 vscode \
|
||||||
|
&& useradd -u 1000 -g 1000 -m -s /bin/bash vscode \
|
||||||
|
&& chown -R vscode:vscode ${ANDROID_HOME} ${FLUTTER_HOME}
|
||||||
|
|
||||||
|
USER vscode
|
||||||
|
WORKDIR /home/vscode/projects
|
||||||
@@ -108,6 +108,7 @@ jobs:
|
|||||||
name: Build Android
|
name: Build Android
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
needs: [lint, test]
|
needs: [lint, test]
|
||||||
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -216,6 +217,7 @@ jobs:
|
|||||||
name: Build iOS
|
name: Build iOS
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
needs: [lint, test]
|
needs: [lint, test]
|
||||||
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
Reference in new issue
Block a user