Skip to content

Commit 5d6d09e

Browse files
committed
Speed up CI image pull by switching to GHCR and adding a minimal test stage
1 parent c84020e commit 5d6d09e

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/build-ci-image.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,24 @@ jobs:
2828
username: ${{ github.actor }}
2929
password: ${{ secrets.GITHUB_TOKEN }}
3030

31-
- name: Build and push
31+
- name: Build and push full image
3232
uses: docker/build-push-action@v7
3333
with:
3434
context: .
35+
target: full
3536
push: true
3637
tags: |
3738
${{ env.GHCR_IMAGE }}:latest
3839
${{ env.GHCR_IMAGE }}:${{ github.sha }}
3940
cache-from: type=gha
4041
cache-to: type=gha,mode=max
42+
43+
- name: Build and push test image
44+
uses: docker/build-push-action@v7
45+
with:
46+
context: .
47+
target: test
48+
push: true
49+
tags: ${{ env.GHCR_IMAGE }}:test
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
contents: read
88
packages: read
99
container:
10-
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:latest
10+
image: ghcr.io/${{ github.repository_owner }}/stackwallet-ci:test
1111
credentials:
1212
username: ${{ github.actor }}
1313
password: ${{ github.token }}

Dockerfile

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.7
2-
FROM ubuntu:24.04
2+
FROM ubuntu:24.04 AS full
33

44
ENV DEBIAN_FRONTEND=noninteractive \
55
TZ=Etc/UTC \
@@ -78,3 +78,35 @@ RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "
7878
RUN git config --system --add safe.directory '*'
7979

8080
RUN flutter --version && rustc --version && cargo --version && node --version
81+
82+
83+
# Minimal image for flutter test (no Rust, no Android SDK, no cross-compilers)
84+
FROM ubuntu:24.04 AS test
85+
86+
ENV DEBIAN_FRONTEND=noninteractive \
87+
TZ=Etc/UTC \
88+
LANG=C.UTF-8 \
89+
LC_ALL=C.UTF-8
90+
91+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
92+
93+
RUN apt-get update && apt-get install -y --no-install-recommends \
94+
ca-certificates curl file git unzip xz-utils \
95+
build-essential cmake ninja-build pkg-config \
96+
clang libclang-dev \
97+
libgirepository1.0-dev libglib2.0-dev libgtk-3-dev \
98+
libjsoncpp-dev liblzma-dev libsecret-1-dev libssl-dev \
99+
&& rm -rf /var/lib/apt/lists/*
100+
101+
ENV FLUTTER_HOME=/opt/flutter \
102+
PATH=/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:$PATH
103+
104+
RUN git clone --depth 1 --branch 3.38.1 https://github.com/flutter/flutter.git "$FLUTTER_HOME" \
105+
&& git config --global --add safe.directory '*' \
106+
&& flutter config --no-analytics \
107+
&& flutter precache --linux \
108+
&& chmod -R a+rwX "$FLUTTER_HOME"
109+
110+
RUN git config --system --add safe.directory '*'
111+
112+
RUN flutter --version

0 commit comments

Comments
 (0)