From 17fc94e5e3e3167bc891f5e9ec812ea0667525b9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 21 Jan 2025 11:36:28 -0500 Subject: [PATCH] ci: Add typos 1.29.4 to Fedora base image --- .gitlab/ci/docker/fedora41/Dockerfile | 14 ++++++++++++++ .gitlab/ci/docker/fedora41/install_rust.sh | 15 +++++++++++++++ .gitlab/ci/docker/fedora41/rust_packages.lst | 1 + .gitlab/os-linux.yml | 2 +- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 .gitlab/ci/docker/fedora41/install_rust.sh create mode 100644 .gitlab/ci/docker/fedora41/rust_packages.lst diff --git a/.gitlab/ci/docker/fedora41/Dockerfile b/.gitlab/ci/docker/fedora41/Dockerfile index ed7daa7640..f7ad10897d 100644 --- a/.gitlab/ci/docker/fedora41/Dockerfile +++ b/.gitlab/ci/docker/fedora41/Dockerfile @@ -6,6 +6,7 @@ FROM ${BASE_IMAGE} AS dnf-cache # Populate DNF cache w/ the fresh metadata and prefetch packages. RUN --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \ --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \ + --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \ --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \ --mount=type=tmpfs,target=/var/log \ --mount=type=tmpfs,target=/tmp \ @@ -18,6 +19,16 @@ RUN --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \ $(grep -h '^[^#]\+$' /root/*.lst) +FROM ${BASE_IMAGE} AS rust-build +LABEL maintainer="Ben Boeckel " + +RUN --mount=type=bind,source=install_rust.sh,target=/root/install_rust.sh \ + --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \ + --mount=type=cache,from=dnf-cache,source=/var/lib/dnf,target=/var/lib/dnf,sharing=private \ + --mount=type=tmpfs,target=/var/log \ + --mount=type=tmpfs,target=/tmp \ + sh /root/install_rust.sh + FROM ${BASE_IMAGE} AS rvm-build LABEL maintainer="Ben Boeckel " @@ -51,6 +62,9 @@ RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \ --mount=type=tmpfs,target=/tmp \ sh /root/install_deps.sh +RUN --mount=type=bind,from=rust-build,source=/root,target=/root \ + tar -C /usr/local -xf /root/rust.tar + RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \ tar -C /usr/local -xf /root/rvm.tar diff --git a/.gitlab/ci/docker/fedora41/install_rust.sh b/.gitlab/ci/docker/fedora41/install_rust.sh new file mode 100755 index 0000000000..0e67bf2516 --- /dev/null +++ b/.gitlab/ci/docker/fedora41/install_rust.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +dnf install \ + --setopt=install_weak_deps=False \ + --setopt=fastestmirror=True \ + --setopt=max_parallel_downloads=10 \ + -y \ + $(grep '^[^#]\+$' /root/rust_packages.lst) + +typos_version=1.29.4 +cargo install --root /usr/local --version "$typos_version" typos-cli + +tar -C /usr/local -cf /root/rust.tar bin/typos diff --git a/.gitlab/ci/docker/fedora41/rust_packages.lst b/.gitlab/ci/docker/fedora41/rust_packages.lst new file mode 100644 index 0000000000..1af6be6048 --- /dev/null +++ b/.gitlab/ci/docker/fedora41/rust_packages.lst @@ -0,0 +1 @@ +rust-cargo-devel diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 3fbc812189..19c8bf415f 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -65,7 +65,7 @@ ### Fedora .fedora41: - image: "kitware/cmake:ci-fedora41-x86_64-2024-11-11" + image: "kitware/cmake:ci-fedora41-x86_64-2025-01-21" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"