Skip to content

Commit 68d0f22

Browse files
authored
Merge branch 'trunk' into js-bidi-codegen
2 parents 2dfef49 + 33365ce commit 68d0f22

304 files changed

Lines changed: 4106 additions & 2094 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ build --flag_alias=pin_browsers=//common:pin_browsers
2121
build --flag_alias=headless=//common:headless
2222

2323
# Set the default java toolchain
24-
build --java_language_version=21
25-
build --java_runtime_version=remotejdk_21
26-
build --tool_java_language_version=21
27-
build --tool_java_runtime_version=remotejdk_21
24+
build --java_language_version=25
25+
build --java_runtime_version=remotejdk_25
26+
build --tool_java_language_version=25
27+
build --tool_java_runtime_version=remotejdk_25
2828

2929
# We target java 11 by default
3030
build --javacopt="--release 11"
@@ -44,6 +44,9 @@ build --nobuild_runfile_links
4444
build --allow_unresolved_symlinks
4545
# Avoid a warning about directory tracking being unsound
4646
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
47+
# Ceiling, not an allocation; small builds still use what they need.
48+
# Bazel's auto-sized default is too low for CI
49+
startup --host_jvm_args=-Xmx8g
4750

4851
# Required for faster TS builds
4952
build --@aspect_rules_ts//ts:skipLibCheck=always
@@ -58,6 +61,10 @@ query --@aspect_rules_ts//ts:default_to_tsc_transpiler
5861

5962
build --incompatible_strict_action_env
6063

64+
# Prevent runner-provided ANDROID_HOME triggering rules_android's SDK fetch.
65+
# Creates a harmless empty repo instead of failing on missing API platforms.
66+
common --repo_env=ANDROID_HOME=
67+
6168
# Required for prebuilt protoc to be used
6269
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc=true
6370

.github/workflows/bazel.yml

Lines changed: 39 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ on:
2626
required: false
2727
type: string
2828
default: ''
29-
caching:
30-
description: Toggle caching of Bazel
31-
required: false
32-
type: boolean
33-
default: true
3429
node-version:
3530
description: Custom Node version to install
3631
required: false
@@ -76,6 +71,11 @@ on:
7671
required: false
7772
type: string
7873
default: ''
74+
cache-save:
75+
description: Save the Bazel cache after the run (avoids multiple jobs clobbering it)
76+
required: false
77+
type: boolean
78+
default: false
7979
gem-trusted-publishing:
8080
description: Exchange GitHub OIDC token for a RubyGems API token (requires trusted publisher configured on rubygems.org)
8181
required: false
@@ -95,19 +95,6 @@ jobs:
9595
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
9696
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
9797
steps:
98-
- name: Remove extra tools to free disk space
99-
if: inputs.os == 'ubuntu'
100-
run: |
101-
echo "Removing extra tools to free disk space..."
102-
echo "Space before: $(df -BG / | tail -1 | awk '{print $4}')"
103-
sudo rm -rf /opt/ghc || true
104-
sudo rm -rf /usr/local/.ghcup || true
105-
sudo rm -rf /usr/local/share/boost || true
106-
sudo rm -rf /usr/share/swift || true
107-
sudo rm -rf /usr/local/julia* || true
108-
sync
109-
after=$(df -BG / | tail -1 | awk '{print $4}')
110-
echo "Space after: ${after}"
11198
- name: Calculate fetch depth
11299
id: depth
113100
shell: bash
@@ -134,31 +121,30 @@ jobs:
134121
fetch-tags: ${{ inputs.fetch-depth != '' }}
135122
- name: Pull latest changes from head ref for PRs
136123
if: contains(github.head_ref, 'renovate/')
124+
shell: bash
137125
run: git pull origin "$HEAD_REF"
138126
env:
139127
HEAD_REF: ${{ github.head_ref }}
140128
- name: Pull latest changes from ref for branch pushes
141129
if: contains(github.ref, 'renovate/')
130+
shell: bash
142131
run: git pull origin "$GIT_REF"
143132
env:
144133
GIT_REF: ${{ github.ref }}
134+
- name: Free disk space
135+
if: inputs.os == 'ubuntu'
136+
run: ./scripts/github-actions/free-disk-space.sh
137+
- name: Free disk space (Windows)
138+
if: inputs.os == 'windows'
139+
shell: pwsh
140+
run: ./scripts/github-actions/free-disk-space.ps1
145141
- name: Restore cache
146142
if: inputs.cache-name != ''
147143
uses: actions/cache/restore@v5
148144
with:
149145
path: ${{ inputs.cache-name }}
150146
key: ${{ inputs.cache-name }}-
151147
restore-keys: ${{ inputs.cache-name }}-
152-
- name: Remove driver directories Windows
153-
if: inputs.os == 'windows'
154-
run: |
155-
rm "$env:ChromeWebDriver" -r -v
156-
rm "$env:EdgeWebDriver" -r -v
157-
rm "$env:GeckoWebDriver" -r -v
158-
- name: Remove driver directories Non-Windows
159-
if: inputs.os != 'windows'
160-
run: |
161-
sudo rm -rf "$CHROMEWEBDRIVER" "$EDGEWEBDRIVER" "$GECKOWEBDRIVER"
162148
- name: Set Python version
163149
if: inputs.python-version != ''
164150
run: echo '${{ inputs.python-version }}' > py/.python-version
@@ -171,50 +157,21 @@ jobs:
171157
with:
172158
node-version: ${{ inputs.node-version }}
173159
- name: Setup Bazel with caching
174-
if: inputs.caching
160+
continue-on-error: true
175161
uses: bazel-contrib/setup-bazel@0.19.0
176162
with:
177-
cache-save: ${{ github.ref_name == 'trunk' }}
163+
cache-save: ${{ inputs.cache-save }}
178164
bazelisk-cache: true
179165
bazelrc: common --color=yes
180166
# Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532
181167
output-base: ${{ inputs.os == 'windows' && 'D://b' || '' }}
182-
cache-version: 2
183168
disk-cache: false
184-
external-cache: |
185-
manifest:
186-
crates: rust/Cargo.Bazel.lock
187-
"rules_ruby++ruby+ruby": false
188-
"+pin_browsers_extension+linux_beta_chrome": false
189-
"+pin_browsers_extension+linux_beta_chromedriver": true
190-
"+pin_browsers_extension+linux_beta_firefox": false
191-
"+pin_browsers_extension+linux_chrome": false
192-
"+pin_browsers_extension+linux_chromedriver": true
193-
"+pin_browsers_extension+linux_edge": false
194-
"+pin_browsers_extension+linux_edgedriver": true
195-
"+pin_browsers_extension+linux_firefox": false
196-
"+pin_browsers_extension+linux_geckodriver": true
197-
"+pin_browsers_extension+mac_beta_chrome": false
198-
"+pin_browsers_extension+mac_beta_chromedriver": false
199-
"+pin_browsers_extension+mac_beta_firefox": false
200-
"+pin_browsers_extension+mac_chrome": false
201-
"+pin_browsers_extension+mac_chromedriver": false
202-
"+pin_browsers_extension+mac_edge": false
203-
"+pin_browsers_extension+mac_edgedriver": false
204-
"+pin_browsers_extension+mac_firefox": false
205-
"+pin_browsers_extension+mac_geckodriver": false
206-
repository-cache: true
207-
- name: Setup Bazel without caching
208-
if: inputs.caching == false
209-
uses: bazel-contrib/setup-bazel@0.19.0
210-
with:
211-
cache-save: false
212-
bazelisk-cache: true
213-
external-cache: |
214-
manifest:
215-
crates: rust/Cargo.Bazel.lock
169+
external-cache: false
216170
repository-cache: true
217-
bazelrc: common --color=yes
171+
- name: Disk status after cache restore
172+
if: inputs.os != 'macos'
173+
shell: bash
174+
run: . ./scripts/github-actions/disk-status.sh
218175
- name: Setup Fluxbox and Xvfb
219176
if: inputs.os == 'ubuntu' && inputs.browser != ''
220177
run: |
@@ -240,8 +197,18 @@ jobs:
240197
- name: Configure RubyGems credentials via OIDC
241198
if: inputs.gem-trusted-publishing
242199
uses: rubygems/configure-rubygems-credentials@main
200+
- name: Disk status before build
201+
if: inputs.os != 'macos'
202+
shell: bash
203+
run: |
204+
. ./scripts/github-actions/disk-status.sh
205+
if [ "$AVAIL_GB" -lt 10 ]; then
206+
echo "::error::Insufficient disk space: ${AVAIL_GB}GB available (need >=10GB)"
207+
exit 1
208+
fi
243209
- name: Run Bazel
244210
id: run-bazel
211+
continue-on-error: true
245212
shell: bash
246213
env:
247214
MSYS_NO_PATHCONV: 1
@@ -252,15 +219,16 @@ jobs:
252219
${{ inputs.run }}
253220
} 2>&1 | tee build/bazel-console.log
254221
- name: Rerun failures with debug
255-
if: failure() && steps.run-bazel.outcome == 'failure'
222+
id: rerun-failures
223+
if: steps.run-bazel.outcome == 'failure'
256224
shell: bash
257225
run: ./scripts/github-actions/rerun-failures.sh '${{ inputs.run }}' '${{ inputs.rerun-with-debug }}'
258226
- name: Collect failed test logs
259-
if: failure() && steps.run-bazel.outcome == 'failure'
227+
if: always() && steps.run-bazel.outcome == 'failure'
260228
shell: bash
261229
run: ./scripts/github-actions/collect-test-logs.sh
262230
- name: Upload failed test logs
263-
if: failure() && steps.run-bazel.outcome == 'failure'
231+
if: always() && steps.run-bazel.outcome == 'failure'
264232
uses: actions/upload-artifact@v7
265233
with:
266234
name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}
@@ -285,13 +253,11 @@ jobs:
285253
path: ${{ inputs.artifact-path || 'changes.patch' }}
286254
retention-days: 6
287255
if-no-files-found: ${{ inputs.artifact-path != '' && 'error' || 'ignore' }}
288-
- name: Check disk space
256+
- name: Low Disk Warning
289257
if: always()
290258
shell: bash
291259
run: |
292-
avail=$(df -k "$GITHUB_WORKSPACE" | awk 'NR==2 {printf "%.0f", $4/1024/1024}')
293-
echo "Remaining disk space: ${avail}GB"
294-
if [ "$avail" -lt 5 ]; then
295-
echo "::error::Low disk space: ${avail}GB remaining"
296-
exit 1
260+
. ./scripts/github-actions/disk-status.sh
261+
if [ "$AVAIL_GB" -lt 5 ]; then
262+
echo "::warning::Low disk space: ${AVAIL_GB}GB remaining"
297263
fi

.github/workflows/ci-python.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,29 @@ jobs:
1616
run: |
1717
bazel build //py:selenium-wheel //py:selenium-sdist
1818
19-
lint:
20-
name: Lint
19+
lint-ruff:
20+
name: Lint (ruff)
2121
uses: ./.github/workflows/bazel.yml
2222
with:
23-
name: Lint
24-
run: ./go py:lint
23+
name: Lint (ruff)
24+
run: bazel run //py:ruff-check -- --no-fix
25+
26+
lint-mypy:
27+
name: Lint (mypy)
28+
uses: ./.github/workflows/bazel.yml
29+
with:
30+
name: Lint (mypy)
31+
run: bazel run //py:mypy
32+
33+
lint-docs:
34+
name: Lint (docs)
35+
uses: ./.github/workflows/bazel.yml
36+
with:
37+
name: Lint (docs)
38+
run: |
39+
bazel run //py:generate-api-listing
40+
bazel run //py:sphinx-autogen
41+
bazel build //py:docs
2542
2643
unit-tests:
2744
name: Unit Tests

.github/workflows/ci-rbe.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ on:
1212
required: false
1313
default: false
1414
type: boolean
15+
workflow_call:
1516

1617
concurrency:
17-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
18+
group: ci-rbe-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
1819
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1920

2021
permissions:
@@ -24,11 +25,11 @@ permissions:
2425
jobs:
2526
test:
2627
name: Test
27-
if: github.event.repository.fork == false && startsWith(github.head_ref, 'renovate/') != true
28+
if: github.event.repository.fork == false
2829
uses: ./.github/workflows/bazel.yml
2930
with:
3031
name: All RBE tests
32+
cache-save: ${{ github.ref_name == 'trunk' }}
3133
rerun-with-debug: true
32-
caching: false
3334
ruby-version: jruby-10.1.0.0
3435
run: ./scripts/github-actions/ci-build.sh ${{ github.event.inputs.disable_test_cache }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI - Renovate - RBE
2+
3+
on:
4+
push:
5+
branches:
6+
- renovate/*
7+
8+
concurrency:
9+
group: ci-renovate-rbe-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
pin:
17+
name: Repin Dependencies
18+
if: github.event.repository.fork == false
19+
uses: ./.github/workflows/bazel.yml
20+
with:
21+
name: Repin Dependencies
22+
run: |
23+
./go all:pin
24+
./go rust:pin
25+
./go format
26+
artifact-name: repin-changes
27+
28+
commit-repins:
29+
name: Commit Repins
30+
needs: pin
31+
permissions:
32+
contents: write
33+
actions: read
34+
uses: ./.github/workflows/commit-changes.yml
35+
with:
36+
artifact-name: repin-changes
37+
commit-message: "Repin dependencies"
38+
39+
test:
40+
name: Test
41+
needs: commit-repins
42+
permissions:
43+
contents: read
44+
packages: read
45+
uses: ./.github/workflows/ci-rbe.yml
46+
47+
ci-gh:
48+
name: CI - GitHub
49+
needs: commit-repins
50+
uses: ./.github/workflows/ci.yml

.github/workflows/ci-ruby.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,5 @@ jobs:
8585
--local_test_jobs 1
8686
--test_size_filters large
8787
--test_tag_filters ${{ matrix.browser }}
88+
${{ (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch') && '--test_env=SKIP_PENDING=true' || '' }}
8889
//rb/spec/...

.github/workflows/ci-rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
name: "Windows Debug"
7878
runs-on: windows-latest
7979
needs: tests
80-
if: github.event_name != 'schedule'
80+
if: github.event_name != 'schedule' && github.event.repository.fork == false && (github.ref == 'refs/heads/trunk' || inputs.release)
8181
env:
8282
RUSTFLAGS: '-Ctarget-feature=+crt-static'
8383
steps:
@@ -136,7 +136,7 @@ jobs:
136136
name: "Linux Debug"
137137
runs-on: ubuntu-latest
138138
needs: tests
139-
if: github.event_name != 'schedule'
139+
if: github.event_name != 'schedule' && github.event.repository.fork == false && (github.ref == 'refs/heads/trunk' || inputs.release)
140140
steps:
141141
- name: "Checkout project"
142142
uses: actions/checkout@v6
@@ -199,7 +199,7 @@ jobs:
199199
name: "MacOS Debug"
200200
runs-on: macos-latest
201201
needs: tests
202-
if: github.event_name != 'schedule'
202+
if: github.event_name != 'schedule' && github.event.repository.fork == false && (github.ref == 'refs/heads/trunk' || inputs.release)
203203
env:
204204
RUSTFLAGS: '-Ctarget-feature=+crt-static'
205205
steps:

0 commit comments

Comments
 (0)