ci(fedora41): move Perforce download to a separate image

It improves parallelization and speeds up the build.
Since downloading is a quick task, put the results to the final image
at the beginning to avoid waiting for other (longer) tasks.
This commit is contained in:
Alex Turbov 2025-01-29 18:06:38 +04:00 committed by Brad King
parent 8946e0a3ba
commit 1edede9276
2 changed files with 9 additions and 4 deletions

View File

@ -49,11 +49,20 @@ RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
sh /root/install_iwyu.sh
FROM ${BASE_IMAGE} AS p4-dl
# Download Perforce.
# NOTE `curl` is pre-installed in the base image.
RUN curl -C- -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz \
| tar -C /usr/local/bin -xvzf - -- p4 p4d
FROM ${BASE_IMAGE}
LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
ENV RBENV_ROOT=/opt/rbenv
COPY --from=p4-dl --chown=root:root /usr/local/bin/p4 /usr/local/bin/p4d /usr/local/bin
RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
--mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
--mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \

View File

@ -15,7 +15,3 @@ find /usr/lib64/python3.13/site-packages/breezy -type d -a -name tests -exec rm
# Ruby rbenv
rbenv install 3.1.2
rbenv global 3.1.2
# Perforce
curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \
| tar -C /usr/local/bin -xvzf - -- p4 p4d