Skip to content

Porting over some Github Actions fixes from the v9 PR #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Test
on:
push:
branches:
- "**"
- master
pull_request:
branches:
branches:
- "**"

env:
Expand Down Expand Up @@ -35,6 +35,8 @@ jobs:
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build & run tests
run: npm run test
- name: Run tests in Saucelabs
run: |
./buildtools/sauce_connect.sh &
npm test -- --saucelabs
./buildtools/run_tests.sh --saucelabs
3 changes: 1 addition & 2 deletions buildtools/generate_test_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
cd "$(dirname $(dirname "$0"))"

echo "Compiling templates..."
npm run build build-soy
npm run build-soy
mkdir -p ./generated
cp -r ./out/soy/* ./generated
npm run build clean

echo "Generating dependency file..."
node $(npm bin)/closure-make-deps \
Expand Down
14 changes: 7 additions & 7 deletions buildtools/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ if [[ $1 = "--saucelabs" ]]; then
seleniumStarted=false
sleep 2
echo "Using SauceLabs."
until [ -f '/tmp/sauce-connect-ready' ]
do
sleep 2
done
# $2 contains the tunnelIdentifier argument if specified, otherwise is empty.
$PROTRACTOR_BIN_PATH/protractor protractor.conf.js --saucelabs $2
fi
else
# https://github.com/angular/webdriver-manager/issues/404
echo "Updating webdriver-manager dependency."
cd ./node_modules/protractor/
npm i webdriver-manager@latest
cd ../../
echo "Using Headless Chrome."
# Updates Selenium Webdriver.
echo "$PROTRACTOR_BIN_PATH/webdriver-manager update --gecko=false"
$PROTRACTOR_BIN_PATH/webdriver-manager update --gecko=false
GOOGLE_CHROME_VERSION=$(google-chrome --product-version || echo 'latest')
echo "$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome $GOOGLE_CHROME_VERSION --gecko=false"
$PROTRACTOR_BIN_PATH/webdriver-manager update --versions.chrome $GOOGLE_CHROME_VERSION --gecko=false
# Start Selenium Webdriver.
echo "$PROTRACTOR_BIN_PATH/webdriver-manager start &>/dev/null &"
$PROTRACTOR_BIN_PATH/webdriver-manager start &>/dev/null &
Expand Down
19 changes: 16 additions & 3 deletions buildtools/sauce_connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#

# Setup and start Sauce Connect locally.
CONNECT_URL="https://saucelabs.com/downloads/sc-4.6.5-linux.tar.gz"
if [[ $OSTYPE == 'darwin'* ]]; then
CONNECT_URL="https://saucelabs.com/downloads/sc-4.7.1-osx.zip"
else
CONNECT_URL="https://saucelabs.com/downloads/sc-4.7.1-linux.tar.gz"
fi
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
CONNECT_DOWNLOAD="sc-latest-linux.tar.gz"

Expand All @@ -33,8 +37,17 @@ mkdir -p $CONNECT_DIR
cd $CONNECT_DIR
curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
mkdir sauce-connect
tar --extract --file=$CONNECT_DOWNLOAD --strip-components=1 \

if [[ $OSTYPE == 'darwin'* ]]; then
unzip -d sauce-connect $CONNECT_DOWNLOAD &&
f=(sauce-connect/*) &&
mv sauce-connect/*/* sauce-connect &&
rmdir "${f[@]}"
else
tar --extract --file=$CONNECT_DOWNLOAD --strip-components=1 \
--directory=sauce-connect > /dev/null
fi

rm $CONNECT_DOWNLOAD

function removeFiles() {
Expand Down Expand Up @@ -63,4 +76,4 @@ echo "Starting Sauce Connect..."

# Start SauceConnect.
sauce-connect/bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY \
-i $TUNNEL_IDENTIFIER
-i $TUNNEL_IDENTIFIER -f $BROWSER_PROVIDER_READY_FILE
Loading