Skip to content

[rust] Fix Windows arm64 logic for Selenium Manager and prepare CI for running the test suite #16046

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

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ jobs:
if: contains(github.ref, 'renovate/')
run: git pull origin ${{ github.ref }}
- name: Free space
if: inputs.os != 'windows'
if: "!contains(inputs.os, 'windows')"
run: ./scripts/github-actions/free-disk-space.sh
- name: Remove driver directories Windows
if: inputs.os == 'windows'
if: contains(inputs.os, 'windows')
run: |
rm "$env:ChromeWebDriver" -r -v
rm "$env:EdgeWebDriver" -r -v
rm "$env:GeckoWebDriver" -r -v
- name: Remove driver directories Non-Windows
if: inputs.os != 'windows'
if: "!contains(inputs.os, 'windows')"
run: |
sudo rm -rf "$CHROMEWEBDRIVER" "$EDGEWEBDRIVER" "$GECKOWEBDRIVER"
- name: Set Ruby version
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
name: ${{ inputs.cache-key }}
manifest:
crates: rust/Cargo.Bazel.lock
rules_ruby++ruby+ruby: ${{ inputs.os == 'windows' && 'false' || 'rb/.ruby-version' }}
rules_ruby++ruby+ruby: ${{ contains(inputs.os, 'windows') && 'false' || 'rb/.ruby-version' }}
repository-cache: true
- name: Setup Bazel without caching
if: inputs.caching == false
Expand All @@ -150,7 +150,7 @@ jobs:
fluxbox -display :99 &
echo "DISPLAY=:99" >> "$GITHUB_ENV"
- name: Set resolution
if: inputs.os == 'windows' && inputs.browser != ''
if: contains(inputs.os, 'windows') && inputs.browser != ''
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: Setup Safari
if: inputs.browser == 'safari'
Expand Down
56 changes: 41 additions & 15 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- os: macos
- os: ubuntu
- os: windows
- os: windows-11-arm
Copy link
Author

@dennisameling dennisameling Jul 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires actions/partner-runner-images#77 to be merged first, which apparently is currently going through a last round of tests and should be published soon 🚀

Alternatively, for the time being, we could use actions-rust-lang/setup-rust-toolchain as suggested here.

with:
name: Tests (${{ matrix.os }})
cache-key: rust-test
Expand All @@ -57,20 +58,31 @@ jobs:
- name: "Update Rust"
run: |
rustup update
rustup toolchain install stable-i686-pc-windows-msvc
rustup default stable-i686-pc-windows-msvc
rustup target install i686-pc-windows-msvc
rustup target install aarch64-pc-windows-msvc
rustc -vV
- name: "Build release binary"
run: cargo build --release
- name: "Build release binary (x86)"
run: cargo build --target i686-pc-windows-msvc --release
working-directory: rust
- name: "Rename binary"
run: mv rust/target/release/selenium-manager.exe selenium-manager-windows.exe
- name: "Upload release binary"
- name: "Build release binary (arm64)"
run: cargo build --target aarch64-pc-windows-msvc --release
working-directory: rust
- name: "Rename binary (x86)"
run: mv rust/target/i686-pc-windows-msvc/release/selenium-manager.exe selenium-manager-windows.exe
- name: "Rename binary (arm64)"
run: mv rust/target/aarch64-pc-windows-msvc/release/selenium-manager.exe selenium-manager-windows-arm64.exe
- name: "Upload release binary (x86)"
uses: actions/upload-artifact@v4
with:
name: selenium-manager-windows
path: selenium-manager-windows.exe
retention-days: 6
- name: "Upload release binary (arm64)"
uses: actions/upload-artifact@v4
with:
name: selenium-manager-windows-arm64
path: selenium-manager-windows-arm64.exe
retention-days: 6

windows-debug:
name: "Windows Debug"
Expand All @@ -87,20 +99,31 @@ jobs:
- name: "Update Rust"
run: |
rustup update
rustup toolchain install stable-i686-pc-windows-msvc
rustup default stable-i686-pc-windows-msvc
rustup target install i686-pc-windows-msvc
rustup target install aarch64-pc-windows-msvc
rustc -vV
- name: "Build release binary"
run: cargo build --profile dev
- name: "Build release binary (x86)"
run: cargo build --target i686-pc-windows-msvc --profile dev
working-directory: rust
- name: "Rename binary"
run: mv rust/target/debug/selenium-manager.exe selenium-manager-windows-debug.exe
- name: "Upload release binary"
- name: "Build release binary (arm64)"
run: cargo build --target aarch64-pc-windows-msvc --profile dev
working-directory: rust
- name: "Rename binary (x86)"
run: mv rust/target/i686-pc-windows-msvc/debug/selenium-manager.exe selenium-manager-windows-debug.exe
- name: "Rename binary (arm64)"
run: mv rust/target/aarch64-pc-windows-msvc/debug/selenium-manager.exe selenium-manager-windows-arm64-debug.exe
- name: "Upload release binary (x86)"
uses: actions/upload-artifact@v4
with:
name: selenium-manager-windows-debug
path: selenium-manager-windows-debug.exe
retention-days: 6
- name: "Upload release binary (arm64)"
uses: actions/upload-artifact@v4
with:
name: selenium-manager-windows-arm64-debug
path: selenium-manager-windows-arm64-debug.exe
retention-days: 6

linux-stable:
name: "Linux Stable"
Expand Down Expand Up @@ -247,7 +270,8 @@ jobs:
linux_sha=$(shasum -a 256 artifacts/selenium-manager-linux/selenium-manager-linux | awk '{print $1}')
macos_sha=$(shasum -a 256 artifacts/selenium-manager-macos/selenium-manager-macos | awk '{print $1}')
windows_sha=$(shasum -a 256 artifacts/selenium-manager-windows/selenium-manager-windows.exe | awk '{print $1}')
echo "{\"macos\": \"$macos_sha\", \"windows\": \"$windows_sha\", \"linux\": \"$linux_sha\"}" > latest.json
windows_arm64_sha=$(shasum -a 256 artifacts/selenium-manager-windows/selenium-manager-windows-arm64.exe | awk '{print $1}')
echo "{\"macos\": \"$macos_sha\", \"windows\": \"$windows_sha\", \"windows-arm64\": \"$windows_arm64_sha\", \"linux\": \"$linux_sha\"}" > latest.json
git config --local user.email "[email protected]"
git config --local user.name "Selenium CI Bot"
git add latest.json
Expand All @@ -268,6 +292,8 @@ jobs:
artifacts/selenium-manager-linux/selenium-manager-linux
artifacts/selenium-manager-macos/selenium-manager-macos
artifacts/selenium-manager-windows/selenium-manager-windows.exe
artifacts/selenium-manager-windows-arm64/selenium-manager-windows-arm64.exe
artifacts/selenium-manager-linux-debug/selenium-manager-linux-debug.tar
artifacts/selenium-manager-macos-debug/selenium-manager-macos-debug.tar
artifacts/selenium-manager-windows-debug/selenium-manager-windows-debug.exe
artifacts/selenium-manager-windows-arm64-debug/selenium-manager-windows-arm64-debug.exe
2 changes: 1 addition & 1 deletion rust/src/electron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl SeleniumManager for ElectronManager {
if X32.is(arch) {
"win32-ia32"
} else if ARM64.is(arch) {
"win32-arm64-x64"
"win32-arm64"
} else {
"win32-x64"
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/firefox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ impl SeleniumManager for FirefoxManager {
if X32.is(arch) || major_browser_version < 42 {
platform_label = "win32";
} else if ARM64.is(arch) {
platform_label = "win-aarch64";
platform_label = "win64-aarch64";
} else {
platform_label = "win64";
}
Expand Down
Loading