2022-11-05 04:04:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
2023-01-11 03:50:32 +01:00
|
|
|
source ../tools.sh
|
|
|
|
|
2022-11-05 04:04:13 +01:00
|
|
|
BUILD_ID=$((RANDOM % 7200 + 600))
|
2023-01-05 07:25:51 +01:00
|
|
|
BROWSER="electron" # Default. Will try to use Google Chrome.
|
2023-01-05 07:15:10 +01:00
|
|
|
|
|
|
|
if hash google-chrome 2>/dev/null; then
|
|
|
|
BROWSER="chrome"
|
|
|
|
echo "Using Google Chrome as a browser."
|
|
|
|
else
|
|
|
|
echo "Google Chrome not found. Using Electron."
|
|
|
|
fi
|
2022-11-05 04:04:13 +01:00
|
|
|
|
|
|
|
# Bundle the updated web code into the server codebase.
|
2023-01-05 07:25:51 +01:00
|
|
|
if [ -z "$SKIP_BUILD" ]; then
|
2023-01-05 07:15:10 +01:00
|
|
|
echo "Bundling web code into server..."
|
2023-01-12 05:11:13 +01:00
|
|
|
|
|
|
|
# Change to the root directory of the repository
|
|
|
|
pushd "$(git rev-parse --show-toplevel)"
|
|
|
|
|
2023-01-05 07:15:10 +01:00
|
|
|
./build/web/bundleWeb.sh >/dev/null
|
2023-01-12 05:11:13 +01:00
|
|
|
|
|
|
|
popd
|
2023-01-05 07:15:10 +01:00
|
|
|
else
|
|
|
|
echo "Skipping web build..."
|
|
|
|
fi
|
2022-11-05 04:04:13 +01:00
|
|
|
|
|
|
|
# Install the web test framework
|
2023-01-05 07:15:10 +01:00
|
|
|
if [ -z "$SKIP_BUILD" ]; then
|
|
|
|
echo "Installing test dependencies..."
|
|
|
|
npm install --quiet --no-progress
|
2022-11-05 04:04:13 +01:00
|
|
|
|
2023-01-05 07:15:10 +01:00
|
|
|
else
|
|
|
|
echo "Skipping dependencies installation"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -o nounset
|
2022-11-05 04:04:13 +01:00
|
|
|
|
2023-01-12 05:11:13 +01:00
|
|
|
install_ffmpeg
|
2022-11-05 04:04:13 +01:00
|
|
|
|
2023-01-12 05:11:13 +01:00
|
|
|
start_owncast
|
2022-11-05 04:04:13 +01:00
|
|
|
|
|
|
|
# Run cypress browser tests for desktop
|
2023-05-23 03:56:44 +02:00
|
|
|
npx cypress run --parallel --browser "$BROWSER" --group "desktop-offline" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js"
|
2022-11-05 04:04:13 +01:00
|
|
|
# Run cypress browser tests for mobile
|
2023-05-23 03:56:44 +02:00
|
|
|
npx cypress run --parallel --browser "$BROWSER" --group "mobile-offline" --env tags=mobile --ci-build-id $BUILD_ID --tag "mobile,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js" --config viewportWidth=375,viewportHeight=667
|
2022-11-05 04:04:13 +01:00
|
|
|
|
2023-01-12 05:11:13 +01:00
|
|
|
start_stream
|
2022-11-05 04:04:13 +01:00
|
|
|
|
|
|
|
# Run cypress browser tests for desktop
|
2023-05-23 03:56:44 +02:00
|
|
|
npx cypress run --parallel --browser "$BROWSER" --group "desktop-online" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js"
|
2022-11-05 04:04:13 +01:00
|
|
|
# Run cypress browser tests for mobile
|
2023-05-23 03:56:44 +02:00
|
|
|
npx cypress run --parallel --browser "$BROWSER" --group "mobile-online" --env tags=mobile --ci-build-id $BUILD_ID --tag "mobile,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js" --config viewportWidth=375,viewportHeight=667
|