refactor(ci): skip bincraft reinstall when image already has it

bincraft is baked into the build-env images, but every workflow run
unconditionally called pak::pak("git::.../bincraft.git") to defend
against bakes where the install silently failed.
That cost ~30-60s per job (pak resolves Remotes, may recompile),
which adds up across all process-updates, update-package-index,
weekly-rebuild and archive-missed-packages workflows.

Guard the call with requireNamespace(): healthy images skip the
install entirely; broken images still self-heal.
This commit is contained in:
Patrick Schratz 2026-05-28 13:39:51 +02:00
commit 63b4a51b31
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -45,7 +45,7 @@ steps:
commands:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- rm -rf /mnt/cache/packages/*
- /opt/R/$R_VERSION/bin/R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraft.git")'
- /opt/R/$R_VERSION/bin/R -q -e 'if (!requireNamespace("bincraft", quietly = TRUE)) pak::pak("git::https://codefloe.com/rpkgs/bincraft.git")'
- /opt/R/$R_VERSION/bin/R -q -e 'pak::pak("pat-s/cranlike@s3")'
- /opt/R/$R_VERSION/bin/R -q -e 'pak::pak("pat-s/desc@description-from-remote")'
- /opt/R/$R_VERSION/bin/R -q -e 'packageVersion("bincraft")'