diff --git a/run-tests.sh b/run-tests.sh index a25f781..cbc5f0b 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -4,12 +4,21 @@ set -euo pipefail SHELLCHECK_SEVERITY=${SHELLCHECK_SEVERITY:-warning} run_test() { + if [ -f /.dockerenv ]; then + eval "$1" + return + fi + podman run --rm -it -v "$(pwd)":/github/workspace:z --env "GITHUB_WORKSPACE=/github/workspace" koji.test "$1" } -pushd test -podman build -t koji.test -f Dockerfile . -popd +if [ ! -f /.dockerenv ]; then + pushd test + podman build -t koji.test -f Dockerfile . + popd +else + echo "Container detected, direct mode." +fi SCRIPTS="$(git ls-files --exclude='*.sh' --ignored | xargs echo)"