Dont use sudo in installation CI if already running as root in docker image

This commit is contained in:
Jordan Carlin 2025-01-05 08:41:02 -08:00 committed by GitHub
parent 2ba67b256c
commit e065594ff4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,12 +108,12 @@ jobs:
run: |
if [ ${{ matrix.imageFamily }} == "debian" ]; then
apt-get update
apt-get install -y sudo git
apt-get install -y git
elif [ ${{ matrix.imageFamily }} == "redhat" ]; then
dnf install -y sudo git
dnf install -y git
dnf install curl -y --allowerasing || true
elif [ ${{ matrix.imageFamily }} == "suse" ]; then
zypper install -y sudo git
zypper install -y git
fi
# Only clone submodules needed for standard tests/regression to save space
- uses: actions/checkout@v4
@ -134,7 +134,9 @@ jobs:
# Run main tool chain installation script, either as a user or system wide
- name: Install
run: |
if [ -z ${{ matrix.user }} ]; then
if [ ! -z ${{ matrix.image }} ]; then
./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
else if [ -z ${{ matrix.user }} ]; then
sudo ./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
else
sudo ./bin/wally-package-install.sh