This commit is contained in:
@@ -37,15 +37,30 @@ jobs:
|
|||||||
-u "$username" \
|
-u "$username" \
|
||||||
--password-stdin
|
--password-stdin
|
||||||
|
|
||||||
- name: Build CI image
|
- name: Build and push CI image
|
||||||
|
env:
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
if docker buildx version >/dev/null 2>&1; then
|
||||||
--build-arg BASE_IMAGE=catthehacker/ubuntu:act-latest \
|
docker buildx create --use --name evol-testbed-builder || docker buildx use evol-testbed-builder
|
||||||
--build-arg LLVM_VERSION=22 \
|
docker buildx build \
|
||||||
--build-arg MESON_VERSION=latest \
|
--build-arg BASE_IMAGE=catthehacker/ubuntu:act-latest \
|
||||||
-t "$REGISTRY_IMAGE:latest" \
|
--build-arg LLVM_VERSION=22 \
|
||||||
-f Dockerfile .
|
--build-arg MESON_VERSION=latest \
|
||||||
|
--cache-from type=registry,ref="$REGISTRY_IMAGE:buildcache" \
|
||||||
- name: Push CI image
|
--cache-to type=registry,ref="$REGISTRY_IMAGE:buildcache",mode=max \
|
||||||
run: |
|
--tag "$REGISTRY_IMAGE:latest" \
|
||||||
docker push "$REGISTRY_IMAGE:latest"
|
--file Dockerfile \
|
||||||
|
--push \
|
||||||
|
.
|
||||||
|
else
|
||||||
|
echo "docker buildx is unavailable; falling back to uncached docker build"
|
||||||
|
docker build \
|
||||||
|
--build-arg BASE_IMAGE=catthehacker/ubuntu:act-latest \
|
||||||
|
--build-arg LLVM_VERSION=22 \
|
||||||
|
--build-arg MESON_VERSION=latest \
|
||||||
|
--tag "$REGISTRY_IMAGE:latest" \
|
||||||
|
--file Dockerfile \
|
||||||
|
.
|
||||||
|
docker push "$REGISTRY_IMAGE:latest"
|
||||||
|
fi
|
||||||
|
|||||||
+10
-6
@@ -1,3 +1,4 @@
|
|||||||
|
# syntax=docker/dockerfile:1.7
|
||||||
# Gitea Actions CI image for C/C++ + Vulkan projects.
|
# Gitea Actions CI image for C/C++ + Vulkan projects.
|
||||||
# This extends the Ubuntu image commonly used by Gitea/act_runner so JS actions
|
# This extends the Ubuntu image commonly used by Gitea/act_runner so JS actions
|
||||||
# such as actions/checkout keep working.
|
# such as actions/checkout keep working.
|
||||||
@@ -24,7 +25,8 @@ ENV STRIP=llvm-strip
|
|||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
# Base compiler/build/Python/Vulkan packages from Ubuntu.
|
# Base compiler/build/Python/Vulkan packages from Ubuntu.
|
||||||
RUN set -eux; \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@@ -55,7 +57,8 @@ RUN set -eux; \
|
|||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# LLVM/Clang from apt.llvm.org.
|
# LLVM/Clang from apt.llvm.org.
|
||||||
RUN set -eux; \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
set -eux; \
|
||||||
codename="$(. /etc/os-release && echo "${VERSION_CODENAME}")"; \
|
codename="$(. /etc/os-release && echo "${VERSION_CODENAME}")"; \
|
||||||
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
|
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
|
||||||
| gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg; \
|
| gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg; \
|
||||||
@@ -76,7 +79,8 @@ RUN set -eux; \
|
|||||||
|
|
||||||
# Optional LunarG Vulkan SDK repo. Disabled by default because Ubuntu distro
|
# Optional LunarG Vulkan SDK repo. Disabled by default because Ubuntu distro
|
||||||
# Vulkan packages are more stable for CI and usually enough for building/testing.
|
# Vulkan packages are more stable for CI and usually enough for building/testing.
|
||||||
RUN set -eux; \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
set -eux; \
|
||||||
if [ "${USE_LUNARG_VULKAN}" = "true" ]; then \
|
if [ "${USE_LUNARG_VULKAN}" = "true" ]; then \
|
||||||
codename="$(. /etc/os-release && echo "${VERSION_CODENAME}")"; \
|
codename="$(. /etc/os-release && echo "${VERSION_CODENAME}")"; \
|
||||||
curl -fsSL https://packages.lunarg.com/lunarg-signing-key-pub.asc \
|
curl -fsSL https://packages.lunarg.com/lunarg-signing-key-pub.asc \
|
||||||
@@ -101,7 +105,8 @@ RUN set -eux; \
|
|||||||
update-alternatives --install /usr/bin/llvm-strip llvm-strip "/usr/bin/llvm-strip-${LLVM_VERSION}" 100
|
update-alternatives --install /usr/bin/llvm-strip llvm-strip "/usr/bin/llvm-strip-${LLVM_VERSION}" 100
|
||||||
|
|
||||||
# Meson in an isolated venv avoids Debian/Ubuntu PEP 668 externally-managed pip errors.
|
# Meson in an isolated venv avoids Debian/Ubuntu PEP 668 externally-managed pip errors.
|
||||||
RUN set -eux; \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
|
set -eux; \
|
||||||
python3 -m venv /opt/meson-venv; \
|
python3 -m venv /opt/meson-venv; \
|
||||||
/opt/meson-venv/bin/python -m pip install --upgrade pip setuptools wheel; \
|
/opt/meson-venv/bin/python -m pip install --upgrade pip setuptools wheel; \
|
||||||
if [ "${MESON_VERSION}" = "latest" ]; then \
|
if [ "${MESON_VERSION}" = "latest" ]; then \
|
||||||
@@ -117,7 +122,6 @@ RUN set -eux; \
|
|||||||
clang --version; \
|
clang --version; \
|
||||||
clang++ --version; \
|
clang++ --version; \
|
||||||
meson --version; \
|
meson --version; \
|
||||||
ninja --version; \
|
ninja --version
|
||||||
vulkaninfo --summary || true
|
|
||||||
|
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
|||||||
Reference in New Issue
Block a user