diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07463c38..e397f686 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,8 @@ jobs: - fedora:latest # glibc 2.37 (as of fedora 38) - rockylinux:8 # glibc 2.28 - rockylinux:8-minimal # glibc 2.28 + - rockylinux:9 # glibc 2.34 + - rockylinux:9-minimal # glibc 2.34 - centos:7 # glibc 2.17 - alpine:latest # musl 1.2.4 (as of alpine 3.18) runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 83462e18..a4816481 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com - Support `cargo-careful`. ([#173](https://github.com/taiki-e/install-action/pull/173)) +- Improve performance and robustness for cases where the host environment lacks the packages required for installation, such as containers or self-hosted runners. + ## [2.12.23] - 2023-07-31 - Update `dprint@latest` to 0.40.0. diff --git a/main.sh b/main.sh index fd077ccb..16cf4bd3 100755 --- a/main.sh +++ b/main.sh @@ -420,14 +420,28 @@ fi if ! type -P jq &>/dev/null || ! type -P curl &>/dev/null || ! type -P tar &>/dev/null; then case "${base_distro}" in - debian | alpine) sys_install ca-certificates curl jq tar ;; - fedora) - if [[ "${dnf}" == "yum" ]]; then + debian | fedora | alpine) + sys_packages=() + if ! type -P curl &>/dev/null; then + sys_packages+=(ca-certificates curl) + fi + if ! type -P tar &>/dev/null; then + sys_packages+=(tar) + fi + if [[ "${dnf:-}" == "yum" ]]; then # On RHEL7-based distribution jq requires EPEL - sys_install ca-certificates curl tar epel-release - sys_install jq --enablerepo=epel + if ! type -P jq &>/dev/null; then + sys_packages+=(epel-release) + sys_install "${sys_packages[@]}" + sys_install jq --enablerepo=epel + else + sys_install "${sys_packages[@]}" + fi else - sys_install ca-certificates curl jq tar + if ! type -P jq &>/dev/null; then + sys_packages+=(jq) + fi + sys_install "${sys_packages[@]}" fi ;; esac