Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: introduce chromium tip-of-tree build (#13664)

Andrey Lushnikov2bf875987b29
diff --git a/.github/workflows/roll_chromium_tip_of_treebuild.yml b/.github/workflows/roll_chromium_tip_of_treebuild.yml
new file mode 100644
index 0000000000..c25c268c0a
--- /dev/null
+++ b/.github/workflows/roll_chromium_tip_of_treebuild.yml
@@ -0,0 +1,43 @@
+name: "PR: bump //browser_patches/chromium-tip-of-tree/BUILD_NUMBER"
+on:
+ workflow_dispatch:
+ schedule:
+ # At 10:00am UTC (3AM PST) every tuesday and thursday to build new Chromium Tip-of-tree
+ - cron: "0 10 * * 2,4"
+jobs:
+ trigger-chromium-build:
+ name: Trigger Build
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - run: ./browser_patches/chromium-tip-of-tree/roll_to_current_tip_of_tree.sh
+ - name: Prepare branch
+ id: prepare-branch
+ run: |
+ if [[ "$(git status --porcelain)" == "" ]]; then
+ echo "there are no changes";
+ exit 0;
+ fi
+ echo "::set-output name=HAS_CHANGES::1"
+ CURRENT_DATE=$(date +%Y-%b-%d)
+ BRANCH_NAME="roll-chromium/${CURRENT_DATE}"
+ echo "::set-output name=BRANCH_NAME::$BRANCH_NAME"
+ echo "::set-output name=CURRENT_DATE::$CURRENT_DATE"
+ git config --global user.name github-actions
+ git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
+ git checkout -b "$BRANCH_NAME"
+ git add .
+ git commit -m "browser(chromium-tip-of-tree): roll to $CURRENT_DATE"
+ git push origin $BRANCH_NAME
+ - name: Create Pull Request
+ if: ${{ steps.prepare-branch.outputs.HAS_CHANGES == '1' }}
+ uses: actions/github-script@v4
+ with:
+ script: |
+ await github.pulls.create({
+ owner: 'microsoft',
+ repo: 'playwright',
+ head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
+ base: 'main',
+ title: 'browser(chromium-tip-of-tree): roll to ${{ steps.prepare-branch.outputs.CURRENT_DATE }}',
+ });
diff --git a/browser_patches/checkout_build_archive_upload.sh b/browser_patches/checkout_build_archive_upload.sh
index cd85b75648..794f7d8c64 100755
--- a/browser_patches/checkout_build_archive_upload.sh
+++ b/browser_patches/checkout_build_archive_upload.sh
@@ -119,6 +119,39 @@ elif [[ "$BUILD_FLAVOR" == "chromium-linux-arm64" ]]; then
EXPECTED_HOST_OS_VERSION="20.04"
BUILD_BLOB_NAME="chromium-linux-arm64.zip"
+# ===========================
+# CHROMIUM-TIP-OF-TREE COMPILATION
+# ===========================
+elif [[ "$BUILD_FLAVOR" == "chromium-tip-of-tree-win64" ]]; then
+ BROWSER_NAME="chromium-tip-of-tree"
+ EXTRA_BUILD_ARGS="--full --goma"
+ EXPECTED_HOST_OS="MINGW"
+ BUILD_BLOB_NAME="chromium-tip-of-tree-win64.zip"
+elif [[ "$BUILD_FLAVOR" == "chromium-tip-of-tree-mac" ]]; then
+ BROWSER_NAME="chromium-tip-of-tree"
+ EXTRA_BUILD_ARGS="--full --goma"
+ EXPECTED_HOST_OS="Darwin"
+ EXPECTED_HOST_OS_VERSION="12.2"
+ BUILD_BLOB_NAME="chromium-tip-of-tree-mac.zip"
+elif [[ "$BUILD_FLAVOR" == "chromium-tip-of-tree-mac-arm64" ]]; then
+ BROWSER_NAME="chromium-tip-of-tree"
+ EXTRA_BUILD_ARGS="--arm64 --full --goma"
+ EXPECTED_HOST_OS="Darwin"
+ EXPECTED_HOST_OS_VERSION="12.2"
+ BUILD_BLOB_NAME="chromium-tip-of-tree-mac-arm64.zip"
+elif [[ "$BUILD_FLAVOR" == "chromium-tip-of-tree-linux" ]]; then
+ BROWSER_NAME="chromium-tip-of-tree"
+ EXTRA_BUILD_ARGS="--full --goma"
+ EXPECTED_HOST_OS="Ubuntu"
+ EXPECTED_HOST_OS_VERSION="18.04"
+ BUILD_BLOB_NAME="chromium-tip-of-tree-linux.zip"
+elif [[ "$BUILD_FLAVOR" == "chromium-tip-of-tree-linux-arm64" ]]; then
+ BROWSER_NAME="chromium-tip-of-tree"
+ EXTRA_BUILD_ARGS="--arm64 --full --goma"
+ EXPECTED_HOST_OS="Ubuntu"
+ EXPECTED_HOST_OS_VERSION="20.04"
+ BUILD_BLOB_NAME="chromium-tip-of-tree-linux-arm64.zip"
+
# ===========================
# CHROMIUM-WITH-SYMBOLS COMPILATION
# ===========================
diff --git a/browser_patches/chromium-tip-of-tree/BUILD_NUMBER b/browser_patches/chromium-tip-of-tree/BUILD_NUMBER
new file mode 100644
index 0000000000..83b33d238d
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/BUILD_NUMBER
@@ -0,0 +1 @@
+1000
diff --git a/browser_patches/chromium-tip-of-tree/EXPECTED_BUILDS b/browser_patches/chromium-tip-of-tree/EXPECTED_BUILDS
new file mode 100644
index 0000000000..2575021ad4
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/EXPECTED_BUILDS
@@ -0,0 +1,5 @@
+chromium-tip-of-tree-mac.zip
+chromium-tip-of-tree-mac-arm64.zip
+chromium-tip-of-tree-linux.zip
+chromium-tip-of-tree-linux-arm64.zip
+chromium-tip-of-tree-win64.zip
diff --git a/browser_patches/chromium-tip-of-tree/UPSTREAM_CONFIG.sh b/browser_patches/chromium-tip-of-tree/UPSTREAM_CONFIG.sh
new file mode 100644
index 0000000000..048765520f
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/UPSTREAM_CONFIG.sh
@@ -0,0 +1,3 @@
+# CURRENT_VERSION: 103.0.5015.0
+# BRANCH_BASE_POSITION: 994112
+BRANCH_COMMIT="4a39a9160f12d8e6ac06c37db137c49682c6db5a"
diff --git a/browser_patches/chromium-tip-of-tree/archive.sh b/browser_patches/chromium-tip-of-tree/archive.sh
new file mode 100755
index 0000000000..3e260dfb0a
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/archive.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+set +x
+
+trap "cd $(pwd -P)" EXIT
+cd "$(dirname "$0")"
+SCRIPT_FOLDER=$(pwd -P)
+
+bash "../chromium/archive.sh" "$@"
diff --git a/browser_patches/chromium-tip-of-tree/build.sh b/browser_patches/chromium-tip-of-tree/build.sh
new file mode 100755
index 0000000000..efc6479c61
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+set +x
+
+trap "cd $(pwd -P)" EXIT
+cd "$(dirname "$0")"
+SCRIPT_FOLDER=$(pwd -P)
+
+bash "../chromium/build.sh" "$@"
diff --git a/browser_patches/chromium-tip-of-tree/clean.sh b/browser_patches/chromium-tip-of-tree/clean.sh
new file mode 100755
index 0000000000..3ea4237e9c
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/clean.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+set +x
+
+trap "cd $(pwd -P)" EXIT
+cd "$(dirname "$0")"
+SCRIPT_FOLDER=$(pwd -P)
+
+bash "../chromium/clean.sh" "$@"
diff --git a/browser_patches/chromium-tip-of-tree/roll_to_current_tip_of_tree.sh b/browser_patches/chromium-tip-of-tree/roll_to_current_tip_of_tree.sh
new file mode 100755
index 0000000000..4ddf20bf32
--- /dev/null
+++ b/browser_patches/chromium-tip-of-tree/roll_to_current_tip_of_tree.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+set +x
+
+trap "cd $(pwd -P)" EXIT
+cd "$(dirname "$0")"
+SCRIPT_FOLDER=$(pwd -P)
+
+# 1. get current version
+CURRENT_BETA_VERSION=$(curl https://omahaproxy.appspot.com/all | grep "win64,canary," | cut -d ',' -f 3)
+VERSION_INFO_JSON=$(curl "https://omahaproxy.appspot.com/deps.json?version=$CURRENT_BETA_VERSION")
+
+NODE_SCRIPT=$(cat <<EOF
+const json = JSON.parse(fs.readFileSync(0));
+console.log([
+ '# CURRENT_VERSION: ' + json.chromium_version,
+ '# BRANCH_BASE_POSITION: ' + json.chromium_base_position,
+ 'BRANCH_COMMIT="' + json.chromium_base_commit + '"',
+].join('\n'));
+EOF
+)
+NEW_CONFIG=$(echo "${VERSION_INFO_JSON}" | node -e "${NODE_SCRIPT}")
+CURRENT_CONFIG=$(cat "${SCRIPT_FOLDER}/UPSTREAM_CONFIG.sh")
+
+if [[ "${CURRENT_CONFIG}" == "${NEW_CONFIG}" ]]; then
+ echo "No changes!"
+ exit 0
+fi
+
+echo "${NEW_CONFIG}" > "${SCRIPT_FOLDER}/UPSTREAM_CONFIG.sh"
+BUILD_NUMBER=$(cat "${SCRIPT_FOLDER}/BUILD_NUMBER")
+echo $(( $BUILD_NUMBER + 1 )) > "${SCRIPT_FOLDER}/BUILD_NUMBER"
diff --git a/browser_patches/prepare_checkout.sh b/browser_patches/prepare_checkout.sh
index 7e7f3c04ee..1e8fe3b35d 100755
--- a/browser_patches/prepare_checkout.sh
+++ b/browser_patches/prepare_checkout.sh
@@ -39,7 +39,14 @@ function maybe_cmd {
function prepare_chromium_checkout {
cd "${SCRIPT_PATH}"
- source "${SCRIPT_PATH}/chromium/UPSTREAM_CONFIG.sh"
+ if [[ $1 == "chromium" ]]; then
+ source "${SCRIPT_PATH}/chromium/UPSTREAM_CONFIG.sh"
+ elif [[ "$1" == "chromium-tot" ]]; then
+ source "${SCRIPT_PATH}/chromium-tip-of-tree/UPSTREAM_CONFIG.sh"
+ else
+ echo "ERROR: unknown type of checkout to prepare - $1"
+ exit 1
+ fi
source "${SCRIPT_PATH}/chromium/ensure_depot_tools.sh"
if [[ -z "${CR_CHECKOUT_PATH}" ]]; then
@@ -80,7 +87,10 @@ BUILD_NUMBER=""
WEBKIT_EXTRA_FOLDER_PATH=""
FIREFOX_EXTRA_FOLDER_PATH=""
if [[ ("$1" == "chromium") || ("$1" == "chromium/") || ("$1" == "cr") ]]; then
- prepare_chromium_checkout
+ prepare_chromium_checkout chromium
+ exit 0
+elif [[ ("$1" == "chromium-tip-of-tree") || ("$1" == "chromium-tot") || ("$1" == "cr-tot") ]]; then
+ prepare_chromium_checkout chromium-tot
exit 0
elif [[ ("$1" == "ffmpeg") || ("$1" == "ffmpeg/") ]]; then
echo "FYI: ffmpeg checkout is not supported. Use '//browser_patches/ffmpeg/build.sh' instead"