build: install lintr in a dedicated stage (#5247)

This commit is contained in:
Marco Ferrari 2024-02-09 18:44:49 +01:00 committed by GitHub
parent a26db6d34d
commit 1f2fbb14cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,6 +95,17 @@ COPY TEMPLATES/.tflint.hcl /action/lib/.automation/
# Initialize TFLint plugins so we get plugin versions listed when we ask for TFLint version # Initialize TFLint plugins so we get plugin versions listed when we ask for TFLint version
RUN tflint --init -c /action/lib/.automation/.tflint.hcl RUN tflint --init -c /action/lib/.automation/.tflint.hcl
FROM python:3.12.1-alpine3.19 as lintr-installer
RUN apk add --no-cache \
bash \
R
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
COPY scripts/install-lintr.sh scripts/install-r-package-or-fail.R /
RUN /install-lintr.sh && rm -rf /install-lintr.sh /install-r-package-or-fail.R
FROM python:3.12.1-alpine3.19 as base_image FROM python:3.12.1-alpine3.19 as base_image
LABEL com.github.actions.name="Super-Linter" \ LABEL com.github.actions.name="Super-Linter" \
@ -204,12 +215,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN /install-chktex.sh && rm -rf /install-ch
# Set work directory back to root because some scripts depend on it # Set work directory back to root because some scripts depend on it
WORKDIR / WORKDIR /
#################
# Install Lintr #
#################
COPY scripts/install-lintr.sh scripts/install-r-package-or-fail.R /
RUN /install-lintr.sh && rm -rf /install-lintr.sh /install-r-package-or-fail.R
################################# #################################
# Install luacheck and luarocks # # Install luacheck and luarocks #
################################# #################################
@ -351,6 +356,11 @@ COPY --from=clang-format /usr/bin/clang-format /usr/bin/
######################## ########################
COPY --from=python-builder /venvs /venvs COPY --from=python-builder /venvs /venvs
#################
# Install Lintr #
#################
COPY --from=lintr-installer /usr/lib/R /usr/lib/R
##################### #####################
# Install Bash-Exec # # Install Bash-Exec #
##################### #####################