mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-04 16:44:11 +03:00
devops: collect host os name and version (#4244)
Our test annotations don't provide (and don't require) a fine-grained information regarding ubuntu version, so we collect it separately.
This commit is contained in:
parent
7fc4b797eb
commit
86e1e3f3fe
@ -44,10 +44,22 @@ export BUILD_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_
|
||||
export COMMIT_SHA=$(git rev-parse HEAD)
|
||||
export COMMIT_TIMESTAMP=$(git show -s --format=%ct HEAD)
|
||||
|
||||
export HOST_OS_NAME="$(uname)"
|
||||
export HOST_OS_VERSION=""
|
||||
if [[ "$HOST_OS_NAME" == "Darwin" ]]; then
|
||||
HOST_OS_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
|
||||
elif [[ "$HOST_OS_NAME" == "Linux" ]]; then
|
||||
HOST_OS_NAME="$(bash -c 'source /etc/os-release && echo $NAME')"
|
||||
HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')"
|
||||
fi
|
||||
|
||||
|
||||
EMBED_METADATA_SCRIPT=$(cat <<EOF
|
||||
const json = require('./' + process.argv[1]);
|
||||
json.metadata = {
|
||||
runURL: process.env.BUILD_URL,
|
||||
osName: process.env.HOST_OS_NAME,
|
||||
osVersion: process.env.HOST_OS_VERSION,
|
||||
commitSHA: process.env.COMMIT_SHA,
|
||||
commitTimestamp: process.env.COMMIT_TIMESTAMP,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user