Skip to content

Commit e2d22fa

Browse files
committed
Set RUNNER_OS fallback in Docker entrypoint
Populate RUNNER_OS from uname when unset, alongside TRAVIS_OS_NAME, so test suites using GitHub Actions-style OS detection behave consistently in local container runs.
1 parent 52de79e commit e2d22fa

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

docker/entrypoint.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,33 @@ ensure_git_identity() {
2020
}
2121

2222
ensure_ci_platform_compat() {
23-
# Some test suites still key off Travis-style OS markers.
24-
if [ -n "$TRAVIS_OS_NAME" ]; then
25-
return
26-
fi
23+
# Some test suites key off Travis-style OS markers while others expect
24+
# GitHub Actions' RUNNER_OS naming.
25+
local travis_name=""
26+
local runner_name=""
2727

2828
case "$(uname -s)" in
2929
Linux*)
30-
export TRAVIS_OS_NAME=linux
30+
travis_name="linux"
31+
runner_name="Linux"
3132
;;
3233
Darwin*)
33-
export TRAVIS_OS_NAME=osx
34+
travis_name="osx"
35+
runner_name="macOS"
3436
;;
3537
CYGWIN*|MINGW*|MSYS*)
36-
export TRAVIS_OS_NAME=windows
38+
travis_name="windows"
39+
runner_name="Windows"
3740
;;
3841
esac
42+
43+
if [ -n "$travis_name" ] && [ -z "$TRAVIS_OS_NAME" ]; then
44+
export TRAVIS_OS_NAME="$travis_name"
45+
fi
46+
47+
if [ -n "$runner_name" ] && [ -z "$RUNNER_OS" ]; then
48+
export RUNNER_OS="$runner_name"
49+
fi
3950
}
4051

4152
sudo sh -e /etc/init.d/xvfb start

0 commit comments

Comments
 (0)