From 5e06a63b35ff62ca3616a877302f2c79427b0d67 Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Mon, 29 Sep 2025 14:30:07 +0200 Subject: [PATCH 1/7] refactor: Minimize the number of images and packages in build process Signed-off-by: Evgeniy Dikevich --- Earthfile | 6 ++-- docs/src/guides/languages/flutter.md | 2 +- earthly/cue/Earthfile | 4 +-- earthly/debian/Earthfile | 3 +- earthly/flutter/Earthfile | 35 +++++++++++++---------- earthly/flutter/installer/Earthfile | 14 +++++---- earthly/flutter_rust_bridge/Earthfile | 23 ++++++++------- earthly/go/Earthfile | 6 ++-- earthly/mdlint/Earthfile | 6 ++-- earthly/playwright/Earthfile | 2 +- earthly/postgresql/Earthfile | 9 ++++-- earthly/python/Earthfile | 13 ++++----- earthly/rust/Earthfile | 5 ++-- examples/flutter/example/Earthfile | 2 +- examples/go/Earthfile | 8 ++++-- utilities/cql-to-d2/Earthfile | 2 +- utilities/earthly-cache-watcher/Earthfile | 2 +- utilities/fetcher/Earthfile | 13 ++++++--- utilities/jorm-metrics-server/Earthfile | 3 +- 19 files changed, 91 insertions(+), 67 deletions(-) diff --git a/Earthfile b/Earthfile index 3e5f9b0b5..6f28c588b 100644 --- a/Earthfile +++ b/Earthfile @@ -5,6 +5,7 @@ IMPORT ./earthly/cspell AS cspell-ci IMPORT ./earthly/bash AS bash-ci IMPORT ./earthly/spectral AS spectral-ci IMPORT ./earthly/python AS python-ci +IMPORT ./earthly/debian AS debian ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library" @@ -23,7 +24,8 @@ markdown-check-fix: # Make sure the project dictionary is properly sorted. clean-spelling-list: - FROM ${REGISTRY}/debian:stable-slim + # FROM ${REGISTRY}/debian:stable-slim + FROM debian+clean DO cspell-ci+CLEAN # check-spelling Check spelling in this repo inside a container. @@ -32,7 +34,7 @@ check-spelling: # check-bash - test all bash files lint properly according to shellcheck. check-bash: - FROM ${REGISTRY}/alpine:3.20.3 + # FROM ${REGISTRY}/alpine:3.20.3 DO bash-ci+SHELLCHECK --src=. diff --git a/docs/src/guides/languages/flutter.md b/docs/src/guides/languages/flutter.md index 7472d7aa8..32e2cdaed 100644 --- a/docs/src/guides/languages/flutter.md +++ b/docs/src/guides/languages/flutter.md @@ -104,7 +104,7 @@ In case you have unit tests in your project, you can run them with `unit-tests` unit-tests: FROM +builder - DO flutter-ci+UNIT_TEST + DO flutter-ci+UNIT_TESTS ``` ### Build Flutter app for Web diff --git a/earthly/cue/Earthfile b/earthly/cue/Earthfile index bae270115..5b00b98ef 100644 --- a/earthly/cue/Earthfile +++ b/earthly/cue/Earthfile @@ -9,7 +9,7 @@ ARG --global CUE_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/cuel INSTALL: FUNCTION - COPY +cue-bin/cue /usr/bin/cue + COPY +cue-bin/cue /usr/bin/cue # Get cue binary @@ -23,4 +23,4 @@ check-cue: DO +INSTALL - RUN cue version \ No newline at end of file + RUN cue version diff --git a/earthly/debian/Earthfile b/earthly/debian/Earthfile index 2af4a76b4..cbb65fe8a 100644 --- a/earthly/debian/Earthfile +++ b/earthly/debian/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 # Define a constant name for the container and its version. -ARG --global DEBIAN_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:13.0-slim" +ARG --global DEBIAN_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim" # Optimally install packages for debian INSTALL: @@ -44,6 +44,7 @@ common: lcov \ tar \ wget \ + build-essential \ xz-utils DO +INSTALL --packages=$PACKAGES diff --git a/earthly/flutter/Earthfile b/earthly/flutter/Earthfile index d2c9a8d1f..b53ee9243 100644 --- a/earthly/flutter/Earthfile +++ b/earthly/flutter/Earthfile @@ -3,6 +3,7 @@ VERSION 0.8 # cspell: words noninteractive IMPORT ./installer AS installer +IMPORT ../debian AS debian ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library" @@ -39,27 +40,30 @@ INSTALL_FLUTTER: # flutter-base installs required tools and packages. flutter-base: - FROM ${REGISTRY}/debian:bookworm-20250203-slim + # FROM ${REGISTRY}/debian:bookworm-20250203-slim + FROM debian+common ENV DEBIAN_FRONTEND=noninteractive # Update and install as same command so if either fails, the whole step fails and is not cached. # sqlite3 and libsqlite3-dev are required for running db tests in CI + # RUN apt-get update --fix-missing && \ + # apt-get install -y \ + # apt-utils \ + # git \ + # curl \ + # gzip \ + # unzip \ + # bzip2 \ + # jq \ + # gpg \ + # lcov \ + # wget \ + # xz-utils \ + # sqlite3 \ + # libsqlite3-dev RUN apt-get update --fix-missing && \ apt-get install -y \ - apt-utils \ - git \ - curl \ - gzip \ - unzip \ - bzip2 \ - bash \ - jq \ - gpg \ - lcov \ - tar \ - wget \ - xz-utils \ sqlite3 \ libsqlite3-dev @@ -142,7 +146,8 @@ FORMAT: RUN melos run format-check ELSE RUN echo "Running flutter format" - RUN flutter format --set-exit-if-changed . + # RUN flutter format --set-exit-if-changed . + RUN dart format --output=none --set-exit-if-changed . END # Dry-runs the publish script for publishable packages. diff --git a/earthly/flutter/installer/Earthfile b/earthly/flutter/installer/Earthfile index 5dbdbb727..107d4c600 100644 --- a/earthly/flutter/installer/Earthfile +++ b/earthly/flutter/installer/Earthfile @@ -68,16 +68,18 @@ INSTALL_FIREFOX_LINUX64: IF [ "$TARGETARCH" = "amd64" ] SET PLATFORM = "linux64" - LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_amd64.deb" + # LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_amd64.deb" ELSE SET PLATFORM = "linux-aarch64" - LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_arm64.deb" + # LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_arm64.deb" END - RUN curl -L ${FIREFOX_URL} -o /tmp/firefox.deb \ - && apt-get update --fix-missing \ - && apt-get --fix-broken install -y /tmp/firefox.deb \ - && rm /tmp/firefox.deb + # RUN curl -L ${FIREFOX_URL} -o /tmp/firefox.deb \ + # && apt-get update --fix-missing \ + # && apt-get --fix-broken install -y /tmp/firefox.deb \ + # && rm /tmp/firefox.deb + RUN apt-get update --fix-missing \ + && apt-get --fix-broken install -y firefox-esr RUN firefox --version diff --git a/earthly/flutter_rust_bridge/Earthfile b/earthly/flutter_rust_bridge/Earthfile index 0c9bcb3ee..38b328ce5 100644 --- a/earthly/flutter_rust_bridge/Earthfile +++ b/earthly/flutter_rust_bridge/Earthfile @@ -4,25 +4,26 @@ VERSION 0.8 IMPORT ../flutter AS flutter-ci IMPORT ../rust AS rust-ci +IMPORT ../debian AS debian # This will be refactored in the future # TODO(bkioshn): https://github.com/input-output-hk/catalyst-ci/issues/322 # builder: Setup necessary tools for `flutter_rust_bridge` builder: - FROM harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim + # FROM harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim + FROM debian+common WORKDIR /work - RUN apt-get update \ - && apt-get install -y \ - apt-utils \ - wget \ - tar \ - xz-utils \ - git \ - build-essential \ - curl \ - unzip + # RUN apt-get update \ + # && apt-get install -y \ + # apt-utils \ + # wget \ + # xz-utils \ + # git \ + # build-essential \ + # curl \ + # unzip DO flutter-ci+INSTALL_FLUTTER DO rust-ci+INSTALL_RUST diff --git a/earthly/go/Earthfile b/earthly/go/Earthfile index 9f06be09f..ff84749ed 100644 --- a/earthly/go/Earthfile +++ b/earthly/go/Earthfile @@ -83,8 +83,10 @@ GO_WASM_TOOL: # Install tinygo LET path = "https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo_${tinygo_version}_${TARGETARCH}.deb" - RUN wget $path - RUN dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb + # RUN wget $path + # RUN dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb + + RUN wget $path && dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb # Install go tools needed for go WASM binding go-wasm-builder: diff --git a/earthly/mdlint/Earthfile b/earthly/mdlint/Earthfile index 03c819f03..a7e241ca4 100644 --- a/earthly/mdlint/Earthfile +++ b/earthly/mdlint/Earthfile @@ -1,5 +1,6 @@ VERSION 0.8 +ARG --global IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/davidanson/markdownlint-cli2-rules:v0.14.0" # cspell: words markdownlint MDLINT_LOCALLY: @@ -35,7 +36,7 @@ MDLINT_LOCALLY: RUN docker run \ --rm \ -v $src:/workdir \ - davidanson/markdownlint-cli2-rules:v0.14.0 \ + $IMAGE \ "**/*.md" \ --config $cfg_file \ $fix @@ -60,9 +61,8 @@ CHECK: # Unlikely this ever needs to be changed. ARG cfg_file=.markdownlint-cli2.jsonc - ARG REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub" - FROM ${REGISTRY}/davidanson/markdownlint-cli2-rules:v0.14.0 + FROM $IMAGE # Status line for what we are about to do. RUN echo Linting Markdown Recursively from: $src diff --git a/earthly/playwright/Earthfile b/earthly/playwright/Earthfile index 081406691..5a1034040 100644 --- a/earthly/playwright/Earthfile +++ b/earthly/playwright/Earthfile @@ -7,7 +7,7 @@ SETUP: FROM mcr.microsoft.com/playwright:v1.48.0-noble WORKDIR $workdir - RUN apt-get update --fix-missing && apt-get install -y apt-utils curl unzip + RUN apt-get update --fix-missing && apt-get install -y apt-utils unzip DO flutter-installer+INSTALL_CHROME_LINUX64 diff --git a/earthly/postgresql/Earthfile b/earthly/postgresql/Earthfile index baa3da070..9d55d2df3 100644 --- a/earthly/postgresql/Earthfile +++ b/earthly/postgresql/Earthfile @@ -4,6 +4,7 @@ VERSION 0.8 IMPORT ../rust/tools AS rust-tools IMPORT ../../utilities/scripts AS scripts IMPORT ../java AS java +IMPORT ../graphviz AS graphviz ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub" @@ -101,9 +102,11 @@ DOCS: FROM +postgres-base - RUN apt-get update && apt-get install -y \ - graphviz \ - wget + # RUN apt-get update && apt-get install -y \ + # graphviz \ + # wget + + DO graphviz+INSTALL # Use the cached java installation from the java Earthfile DO java+COPY_DEPS diff --git a/earthly/python/Earthfile b/earthly/python/Earthfile index 4f0eb2389..5079f1f73 100644 --- a/earthly/python/Earthfile +++ b/earthly/python/Earthfile @@ -18,15 +18,12 @@ python-base: # Install necessary packages LET PACKAGES= \ - bash \ curl \ libffi-dev \ - gcc \ musl-dev \ zlib1g-dev \ libjpeg-dev \ - git \ - jq + git DO debian+INSTALL --packages=$PACKAGES # Install CUE @@ -71,7 +68,7 @@ BUILDER: ARG opts # Copy our dependencies. - COPY pyproject.toml poetry.lock Readme.md . + COPY --if-exists pyproject.toml poetry.lock Readme.md README.md . # Install it all with poetry RUN poetry install $opts @@ -91,11 +88,13 @@ LINT_PYTHON: # Where we want to run the `lint` from. Use `.` to check the whole repo. ARG src=. - FROM ${PYTHON_IMAGE}:3.13 + # FROM ${PYTHON_IMAGE}:3.13 + FROM ${PYTHON_IMAGE}:3.13-slim-trixie WORKDIR /work # Install ruff - RUN pip install ruff + # RUN pip install ruff + RUN pip3 install ruff COPY $src . COPY cat-ci+repo-config/repo/ruff.toml ruff.toml.std diff --git a/earthly/rust/Earthfile b/earthly/rust/Earthfile index ff147bd94..cb50d51b6 100644 --- a/earthly/rust/Earthfile +++ b/earthly/rust/Earthfile @@ -11,6 +11,7 @@ IMPORT github.com/earthly/lib/rust:3.0.3 AS rust IMPORT ./tools AS rust-tools IMPORT ../../utilities/scripts AS scripts IMPORT ../debian AS debian +IMPORT ../graphviz AS graphviz # cspell: words miri ripgrep toolset lcov psycopg # cspell: words TARGETPLATFORM TARGETOS TARGETARCH TARGETVARIANT USERPLATFORM USEROS USERARCH USERVARIANT @@ -45,7 +46,6 @@ rust-base: # Note: openssl-dev and openssl-libs-static are added to support the cargo-component crate. # if that crate is removed, these dependencies can also be removed. LET PACKAGES= \ - bash \ build-essential \ clang \ cmake \ @@ -53,7 +53,6 @@ rust-base: findutils \ fontconfig \ fonts-liberation2 \ - graphviz \ libssl-dev \ mold \ openssl \ @@ -72,7 +71,7 @@ rust-base: END DO debian+INSTALL --packages=$PACKAGES - + DO graphviz+INSTALL # Fix up font cache. RUN fc-cache -f diff --git a/examples/flutter/example/Earthfile b/examples/flutter/example/Earthfile index 9f87dde07..d6738b239 100644 --- a/examples/flutter/example/Earthfile +++ b/examples/flutter/example/Earthfile @@ -27,7 +27,7 @@ format: unit-tests: FROM +builder - DO flutter-ci+UNIT_TEST + DO flutter-ci+UNIT_TESTS # Build the Flutter app for the web. # Assuming that we have a main.dart file in lib folder and we run `build-web` in folder diff --git a/examples/go/Earthfile b/examples/go/Earthfile index a1cba14f5..12f4086e1 100644 --- a/examples/go/Earthfile +++ b/examples/go/Earthfile @@ -4,16 +4,20 @@ VERSION 0.8 IMPORT ../../earthly/go AS go-ci +ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library" + # The structure of this Earthfile is derived from the style guide: # https://input-output-hk.github.io/catalyst-ci/style/#adhere-to-a-consistent-structure deps: # This target is used to install external Go dependencies. - FROM golang:1.22.4-alpine3.20 + # FROM ${REGISTRY}/golang:1.22.4-alpine3.20 + FROM ${REGISTRY}/golang:1.24.5-bookworm WORKDIR /work # Any build dependencies should also be captured in this target. - RUN apk add --no-cache gcc musl-dev + # RUN apk add --no-cache gcc musl-dev + RUN apt-get update && apt-get install -y musl-dev # This FUNCTION automatically copies the go.mod and go.sum files and runs # `go mod download` to install the dependencies. diff --git a/utilities/cql-to-d2/Earthfile b/utilities/cql-to-d2/Earthfile index 256346b46..594b5f5e0 100644 --- a/utilities/cql-to-d2/Earthfile +++ b/utilities/cql-to-d2/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.7 AS python-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.5.17 AS python-ci check: FROM python-ci+python-base diff --git a/utilities/earthly-cache-watcher/Earthfile b/utilities/earthly-cache-watcher/Earthfile index 55d9ce2ea..9190c5694 100644 --- a/utilities/earthly-cache-watcher/Earthfile +++ b/utilities/earthly-cache-watcher/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.1.7 AS python-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.5.17 AS python-ci check: FROM python-ci+python-base diff --git a/utilities/fetcher/Earthfile b/utilities/fetcher/Earthfile index 3034de145..82fcbf63f 100644 --- a/utilities/fetcher/Earthfile +++ b/utilities/fetcher/Earthfile @@ -1,7 +1,10 @@ VERSION 0.8 -ARG REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library" -FROM ${REGISTRY}/golang:1.22.4-alpine3.20 +IMPORT ../../earthly/debian AS debian + +ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library" +# FROM ${REGISTRY}/golang:1.22.4-alpine3.20 +FROM ${REGISTRY}/golang:1.24.5-bookworm IMPORT ../../earthly/go AS go-ci @@ -17,7 +20,8 @@ deps: WORKDIR /work CACHE --persist --sharing shared /go - RUN apk add --no-cache gcc musl-dev + # RUN apk add --no-cache gcc musl-dev + RUN apt-get update && apt-get install -y musl-dev DO go-ci+DEPS src: @@ -51,7 +55,8 @@ github: SAVE ARTIFACT bin/fetcher fetcher docker: - FROM debian:bookworm-slim + # FROM ${REGISTRY}/debian:bookworm-slim + FROM debian+debian-clean WORKDIR /workspace ARG container="jorm-fetcher" diff --git a/utilities/jorm-metrics-server/Earthfile b/utilities/jorm-metrics-server/Earthfile index 6f03e605b..e9c1ab4fb 100644 --- a/utilities/jorm-metrics-server/Earthfile +++ b/utilities/jorm-metrics-server/Earthfile @@ -1,6 +1,7 @@ VERSION 0.8 -ARG --global IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/python:3.13-slim-bookworm" +# ARG --global IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/python:3.13-slim-bookworm" +ARG --global IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/python:3.13-slim-trixie" deps: FROM $IMAGE From 922f50cb1650bfba50cac905c60876e063532f1a Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Wed, 1 Oct 2025 15:21:58 +0200 Subject: [PATCH 2/7] Install UV through ghcr image Signed-off-by: Evgeniy Dikevich --- earthly/python/Earthfile | 21 +++++++++++++++------ earthly/uv/Earthfile | 22 ++++++++++++++++++++++ earthly/uv/blueprint.cue | 1 + 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 earthly/uv/Earthfile create mode 100644 earthly/uv/blueprint.cue diff --git a/earthly/python/Earthfile b/earthly/python/Earthfile index 5079f1f73..4d056642d 100644 --- a/earthly/python/Earthfile +++ b/earthly/python/Earthfile @@ -6,6 +6,7 @@ IMPORT ../../ AS cat-ci IMPORT ../debian AS debian IMPORT ../cue AS cue IMPORT ../graphviz AS graphviz +IMPORT ../uv AS uv # Define a constant name for the container and its version. @@ -48,13 +49,20 @@ python-base: RUN poetry config installer.max-workers 10 # Install UV through the recommended installer. - RUN curl -LsSf https://astral.sh/uv/install.sh | sh + # RUN curl -LsSf https://astral.sh/uv/install.sh | sh ENV PATH=$HOME/.local/bin:$PATH + DO uv+INSTALL + # Install ruff for linting. - RUN pip3 install ruff - RUN pip3 install rich - RUN pip3 install third-party-imports + # RUN pip3 install ruff + # RUN pip3 install rich + # RUN pip3 install third-party-imports + + # RUN uv pip install ruff --system + RUN uv tool install ruff + RUN uv pip install rich --system + RUN uv pip install third-party-imports --system # Universal build scripts we will always need and are not target dependent. COPY --dir scripts /scripts @@ -89,12 +97,13 @@ LINT_PYTHON: ARG src=. # FROM ${PYTHON_IMAGE}:3.13 - FROM ${PYTHON_IMAGE}:3.13-slim-trixie + # FROM ${PYTHON_IMAGE}:3.13-slim-trixie + + FROM +python-base WORKDIR /work # Install ruff # RUN pip install ruff - RUN pip3 install ruff COPY $src . COPY cat-ci+repo-config/repo/ruff.toml ruff.toml.std diff --git a/earthly/uv/Earthfile b/earthly/uv/Earthfile new file mode 100644 index 000000000..f6a898bb8 --- /dev/null +++ b/earthly/uv/Earthfile @@ -0,0 +1,22 @@ +VERSION 0.8 + +IMPORT ../debian AS debian + +ARG --global UV_IMAGE="harbor.shared-services.projectcatalyst.io/ghcr/astral-sh/uv:python3.13-trixie-slim" + + +INSTALL: + FUNCTION + + COPY +uv-bin/uv /usr/local/bin/uv + +uv-bin: + FROM $UV_IMAGE + SAVE ARTIFACT /usr/local/bin/uv + +check-uv: + FROM debian+common + + DO +INSTALL + + RUN uv --version diff --git a/earthly/uv/blueprint.cue b/earthly/uv/blueprint.cue new file mode 100644 index 000000000..870eee36e --- /dev/null +++ b/earthly/uv/blueprint.cue @@ -0,0 +1 @@ +project: name: "ci-uv" From 6ff65707a9ceb76dbf748e88e614f324a41e4a40 Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Wed, 1 Oct 2025 16:23:00 +0200 Subject: [PATCH 3/7] Debug Signed-off-by: Evgeniy Dikevich --- earthly/debian/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/earthly/debian/Earthfile b/earthly/debian/Earthfile index cbb65fe8a..8a7589e64 100644 --- a/earthly/debian/Earthfile +++ b/earthly/debian/Earthfile @@ -45,6 +45,7 @@ common: tar \ wget \ build-essential \ + gcc \ xz-utils DO +INSTALL --packages=$PACKAGES From fa63195c24312f15d3e6b8082b264ddcbfd7c75a Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Thu, 2 Oct 2025 15:10:51 +0200 Subject: [PATCH 4/7] Use latest chrome and chromium Signed-off-by: Evgeniy Dikevich --- earthly/debian/Earthfile | 4 -- earthly/flutter/installer/Earthfile | 84 ++++++++++++++++++----------- 2 files changed, 52 insertions(+), 36 deletions(-) diff --git a/earthly/debian/Earthfile b/earthly/debian/Earthfile index 8a7589e64..3cbeb9e96 100644 --- a/earthly/debian/Earthfile +++ b/earthly/debian/Earthfile @@ -35,17 +35,13 @@ common: apt-utils \ git \ curl \ - gzip \ unzip \ bzip2 \ - bash \ jq \ gpg \ lcov \ - tar \ wget \ build-essential \ - gcc \ xz-utils DO +INSTALL --packages=$PACKAGES diff --git a/earthly/flutter/installer/Earthfile b/earthly/flutter/installer/Earthfile index 107d4c600..3a6f35bec 100644 --- a/earthly/flutter/installer/Earthfile +++ b/earthly/flutter/installer/Earthfile @@ -26,31 +26,51 @@ INSTALL_CHROME_LINUX64: # You must provide it as ARG, e.g., `ARG TARGETARCH` in your function to use it. # Read more about it here: https://docs.earthly.dev/docs/earthfile/builtin-args#platform-related-args IF [ "$TARGETARCH" = "amd64" ] + # RUN printf "${BLUE} Installing Google Chrome..." \ + # && curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \ + # && unzip /opt/chrome.zip -d /opt/chrome \ + # && dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \ + # && dpkg -i /opt/chrome/chrome_amd64/*.deb || true \ + # && echo "Check and fix missing dependencies..." \ + # && apt-get update --fix-missing \ + # && apt-get install -f -y \ + # && rm -rf /opt/chrome.zip /opt/chrome + # RUN google-chrome --version + # DO +PATCH_CHROME --BIN_TO_PATCH="google-chrome" + + # RUN printf "${BLUE} Installing Chromedriver..." \ + # && mkdir -p /opt/chromedriver \ + # && curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \ + # -o /opt/chromedriver/chromedriver.zip \ + # && unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/ + # RUN chromedriver --version + RUN printf "${BLUE} Installing Google Chrome..." \ - && curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \ - && unzip /opt/chrome.zip -d /opt/chrome \ - && dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \ - && dpkg -i /opt/chrome/chrome_amd64/*.deb || true \ + && curl -sSL -o /opt/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && dpkg -i /opt/chrome.deb || true \ && echo "Check and fix missing dependencies..." \ && apt-get update --fix-missing \ - && apt-get install -f -y \ - && rm -rf /opt/chrome.zip /opt/chrome + && apt-get install -f -y \ + && rm -rf /opt/chrome.deb RUN google-chrome --version DO +PATCH_CHROME --BIN_TO_PATCH="google-chrome" RUN printf "${BLUE} Installing Chromedriver..." \ && mkdir -p /opt/chromedriver \ - && curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \ + && CHROME_VERSION=$(google-chrome --version | cut -d' ' -f3) \ + && curl -L "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \ -o /opt/chromedriver/chromedriver.zip \ && unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/ RUN chromedriver --version ELSE - DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium.zip" + # DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium.zip" + RUN apt-get update --fix-missing \ + && apt-get install -y chromium chromium-driver RUN chromium --version DO +PATCH_CHROME --BIN_TO_PATCH="chromium" - DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium-driver" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium-driver.zip" + # DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium-driver" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium-driver.zip" RUN chromedriver --version END @@ -120,29 +140,29 @@ INSTALL_EDGE_LINUX64: END # Installs the Chromium or Chromium driver. -INSTALL_CHROMIUM: - FUNCTION - - ARG --required PACKAGE_TYPE - ARG --required DOWNLOAD_URL - LET BLUE='\033[0;34m' - - RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n" \ - && echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \ - && curl -sSL -o /opt/${PACKAGE_TYPE}.zip ${DOWNLOAD_URL} \ - && echo "Downloaded file information:" \ - && ls -lh /opt/${PACKAGE_TYPE}.zip \ - && echo "Unzipping ${PACKAGE_TYPE} packages..." \ - && unzip /opt/${PACKAGE_TYPE}.zip -d /opt/${PACKAGE_TYPE} \ - && echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \ - && ls -lh /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE} \ - && echo "Installing ${PACKAGE_TYPE} and dependencies..." \ - && dpkg -i /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE}/*.deb || true \ - && echo "Checking for missing dependencies..." \ - && echo "Cleaning up..." \ - && rm /opt/${PACKAGE_TYPE}.zip \ - && rm -r /opt/${PACKAGE_TYPE} \ - && echo "${PACKAGE_TYPE} installation completed." +# INSTALL_CHROMIUM: +# FUNCTION + +# ARG --required PACKAGE_TYPE +# ARG --required DOWNLOAD_URL +# LET BLUE='\033[0;34m' + +# RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n" \ +# && echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \ +# && curl -sSL -o /opt/${PACKAGE_TYPE}.zip ${DOWNLOAD_URL} \ +# && echo "Downloaded file information:" \ +# && ls -lh /opt/${PACKAGE_TYPE}.zip \ +# && echo "Unzipping ${PACKAGE_TYPE} packages..." \ +# && unzip /opt/${PACKAGE_TYPE}.zip -d /opt/${PACKAGE_TYPE} \ +# && echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \ +# && ls -lh /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE} \ +# && echo "Installing ${PACKAGE_TYPE} and dependencies..." \ +# && dpkg -i /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE}/*.deb || true \ +# && echo "Checking for missing dependencies..." \ +# && echo "Cleaning up..." \ +# && rm /opt/${PACKAGE_TYPE}.zip \ +# && rm -r /opt/${PACKAGE_TYPE} \ +# && echo "${PACKAGE_TYPE} installation completed." PATCH_CHROME: FUNCTION From 2ba9ceea170ed8dd3ca9349564886e4abeca802d Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Thu, 2 Oct 2025 17:48:05 +0200 Subject: [PATCH 5/7] Try Germany mirror Signed-off-by: Evgeniy Dikevich --- earthly/debian/Earthfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/earthly/debian/Earthfile b/earthly/debian/Earthfile index 3cbeb9e96..870be8fc7 100644 --- a/earthly/debian/Earthfile +++ b/earthly/debian/Earthfile @@ -30,6 +30,8 @@ debian-clean: common: FROM +debian-clean + RUN sed -i 's|deb.debian.org|ftp.de.debian.org|g' /etc/apt/sources.list.d/debian.sources + LET PACKAGES= \ ca-certificates \ apt-utils \ From 61be397cffdcce15f4f62dd38cd8dc3a5f79e0c9 Mon Sep 17 00:00:00 2001 From: Evgeniy Dikevich Date: Thu, 2 Oct 2025 18:18:42 +0200 Subject: [PATCH 6/7] Revert Signed-off-by: Evgeniy Dikevich --- earthly/debian/Earthfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/earthly/debian/Earthfile b/earthly/debian/Earthfile index 870be8fc7..3cbeb9e96 100644 --- a/earthly/debian/Earthfile +++ b/earthly/debian/Earthfile @@ -30,8 +30,6 @@ debian-clean: common: FROM +debian-clean - RUN sed -i 's|deb.debian.org|ftp.de.debian.org|g' /etc/apt/sources.list.d/debian.sources - LET PACKAGES= \ ca-certificates \ apt-utils \ From 468d34d9617e206827c5a9754f35ef4c9f173483 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Tue, 7 Oct 2025 12:33:58 +0200 Subject: [PATCH 7/7] fix: failing flutter widget tests --- .../flutter/example/test/widget_test.dart | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/flutter/example/test/widget_test.dart b/examples/flutter/example/test/widget_test.dart index 092d222f7..0c571a71b 100644 --- a/examples/flutter/example/test/widget_test.dart +++ b/examples/flutter/example/test/widget_test.dart @@ -8,23 +8,23 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:example/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); + await tester.pumpWidget(const _TestApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); + }); +} - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); +class _TestApp extends StatelessWidget { + const _TestApp(); - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); + @override + Widget build(BuildContext context) { + return const MaterialApp( + home: Scaffold(body: Center(child: Text('0'))), + ); + } }