Skip to content

Commit 965fdbe

Browse files
committed
refactor: enhance Docker command compatibility for Alpine Linux and improve package installation handling
1 parent 8c36281 commit 965fdbe

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ jobs:
279279

280280
- name: Run Extended Tests in Container
281281
run: |
282-
docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.distro }} bash -c "
282+
# Use sh for Alpine Linux (bash not available by default), bash for others
283+
if [[ "${{ matrix.distro }}" == alpine* ]]; then
284+
SHELL_CMD="sh"
285+
else
286+
SHELL_CMD="bash"
287+
fi
288+
docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.distro }} $SHELL_CMD -c "
283289
set -e
284290
285291
echo '=== Setting up ${{ matrix.scenario }} ==='
@@ -293,15 +299,17 @@ jobs:
293299
;;
294300
dnf)
295301
dnf update -y
296-
dnf install -y curl wget sudo procps grep sed gawk coreutils which
302+
# Use --allowerasing to handle coreutils conflicts in RHEL/Rocky/Alma
303+
dnf install -y --allowerasing curl wget sudo procps grep sed gawk coreutils which
297304
;;
298305
pacman)
299306
pacman -Sy --noconfirm
300307
pacman -S --noconfirm curl wget sudo procps grep sed gawk coreutils which
301308
;;
302309
apk)
303310
apk update
304-
apk add curl wget sudo procps grep sed gawk coreutils bash
311+
# Install bash and other essential tools for Alpine
312+
apk add bash curl wget sudo procps grep sed gawk coreutils
305313
;;
306314
esac
307315

0 commit comments

Comments
 (0)