-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathinstall_test_workflow_prereqs.sh
executable file
·85 lines (75 loc) · 2.24 KB
/
install_test_workflow_prereqs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash -e
# Copyright 2022 Google LLC
PLATFORM='Desktop'
TEST_ONLY=''
ARCH=''
SSL=''
# check options
while getopts ":p:a:t:s:" opt; do
case $opt in
p)
PLATFORM=$OPTARG
;;
a)
ARCH=$OPTARG
;;
t)
if [[ $OPTARG == true ]]; then
TEST_ONLY="--running_only"
fi
;;
s)
SSL=$OPTARG
;;
*)
echo "unknown parameter"
echo $OPTARG
exit 2
;;
esac
done
echo "PLATFORM: ${PLATFORM}"
echo "ARCH: ${ARCH}"
echo "TEST_ONLY: ${TEST_ONLY}"
echo "SSL: ${SSL}"
OS=''
case "$OSTYPE" in
darwin*) OS='Mac' ;;
linux*) OS='Linux' ;;
msys*) OS='Windows' ;;
*) echo "unknown: $OSTYPE" ;;
esac
echo "OS: ${OS}"
pip3 install -r scripts/gha/python_requirements.txt
git config --global credential.helper 'store --file /tmp/git-credentials'
echo 'https://${GITHUB_TOKEN}@github.com' > /tmp/git-credentials
if [[ "${OS}" == "Windows" ]]; then
git config --system core.longpaths true
fi
if [[ "${OS}" == "Mac" ]]; then
sudo xcode-select -s /Applications/Xcode_${xcodeVersion}.app/Contents/Developer
fi
if [[ "${PLATFORM}" == "Desktop" ]]; then
if [[ "${OS}" == "Linux" ]]; then
VCPKG_TRIPLET="x64-linux"
elif [[ "${OS}" == "Mac" ]]; then
VCPKG_TRIPLET="x64-osx"
echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]" >> $GITHUB_ENV
elif [[ "${OS}" == "Windows" ]]; then
VCPKG_TRIPLET="x64-windows-static"
fi
echo "VCPKG_TRIPLET=${VCPKG_TRIPLET}" >> $GITHUB_ENV
echo "VCPKG_RESPONSE_FILE=external/vcpkg_${VCPKG_TRIPLET}_response_file.txt" >> $GITHUB_ENV
python3 scripts/gha/install_prereqs_desktop.py --gha_build --arch "${ARCH}" --ssl "${SSL}" ${TEST_ONLY}
fi
if [[ "${TEST_ONLY}" == "" ]]; then
if [[ "${PLATFORM}" == "Android" ]]; then
echo "NDK_ROOT=/tmp/android-ndk-r21e" >> $GITHUB_ENV
echo "ANDROID_NDK_HOME=/tmp/android-ndk-r21e" >> $GITHUB_ENV
build_scripts/android/install_prereqs.sh
elif [[ "${PLATFORM}" == "iOS" ]]; then
build_scripts/ios/install_prereqs.sh
elif [[ "${PLATFORM}" == "tvOS" ]]; then
build_scripts/tvos/install_prereqs.sh
fi
fi