Skip to content

Commit

Permalink
Update scripts-testing.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Nov 1, 2024
1 parent c8d3442 commit 701bef8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/scripts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ jobs:
local _shell
_shell="$(realpath "${1:?}")" || return 2
case "${EXECUTED_LIST?}|" in
*"|${_shell:?}|"*) return 1 ;; # Already executed
*"|${_shell:?} ${2?}|"*) return 1 ;; # Already executed
*) ;;
esac
EXECUTED_LIST="${EXECUTED_LIST?}|${_shell:?}"
EXECUTED_LIST="${EXECUTED_LIST?}|${_shell:?} ${2?}"
return 0 # NOT already executed
}
skip()
Expand All @@ -165,7 +165,7 @@ jobs:
fi
if test "${1:?}" = 'cmdline.sh'; then
case "${_s_shell?}" in
obosh | busybox-x86-legacy) return 0 ;; # Skip
obosh | busybox-x86 | busybox-x86-legacy) return 0 ;; # Skip
*) ;;
esac
else
Expand All @@ -179,9 +179,15 @@ jobs:
}
set_bb_applet()
{
if test "${CURRENT_SHELL:-none}" != "${1:?}"; then
case "${1:?}" in 'busybox'*) ;;
*)
CURRENT_APPLET=''
CURRENT_SHELL="${1:?}"
return 0
;;
esac
if test "${CURRENT_SHELL:-none}" != "${2:?}"; then
CURRENT_APPLET=''
CURRENT_SHELL="${2:?}"
fi
case "${CURRENT_APPLET?}" in
ash) CURRENT_APPLET='hush' ;;
Expand All @@ -195,14 +201,12 @@ jobs:
for _shell in sh dash bash busybox busybox-x86 busybox-x86 busybox-x86-legacy busybox-x86-legacy ash hush mksh pdksh oksh ksh88 ksh93 ksh zsh yash posh osh bosh pbosh obosh; do
if test "${_shell:?}" = 'ksh' && test -n "${ORIGINAL_KSH?}"; then _shell="${ORIGINAL_KSH:?}"; fi
if ! _shell_cmd="$(command -v "${_shell:?}")" || skip "${1:?}" "${_shell:?}"; then continue; fi
if test "${_shell:?}" != 'busybox-x86' && test "${_shell:?}" != 'busybox-x86-legacy' && ! not_already_excuted "${_shell_cmd:?}"; then continue; fi
set_bb_applet "${_shell:?}" "${_shell_cmd:?}"
if ! not_already_excuted "${_shell_cmd:?}" "${CURRENT_APPLET?}"; then continue; fi
printf 'SHELL: %s - SCRIPT: %s\n\n' "${_shell_cmd:?}" "${1:?}"
_status='0'
case "${_shell:?}" in
'busybox'*)
set_bb_applet "${_shell_cmd:?}"
"${_shell_cmd:?}" "${CURRENT_APPLET:?}" "${workspace_dir:?}/${1:?}" ${2-} || _status="${?}"
;;
'busybox'*) "${_shell_cmd:?}" "${CURRENT_APPLET:?}" "${workspace_dir:?}/${1:?}" ${2-} || _status="${?}" ;;
*) "${_shell_cmd:?}" "${workspace_dir:?}/${1:?}" ${2-} || _status="${?}" ;;
esac
test "${_status:?}" = 0 || EXIT_CODE="${_status:?}"
Expand Down

0 comments on commit 701bef8

Please sign in to comment.