This action sets up Google Chrome/Chromium for GitHub Actions. This action supports the following features:
- Install and set up Google Chrome onto the runner.
- Install a specific version of Google Chrome/Chromium by the version number, commit position, and release channel.
- Cross-platform runner support (Windows, macOS, Linux) and self-hosted runner support.
- Install the compatible versions of ChromeDriver with the browser.
Here is a basic usage. The action installs the stable version of Chrome for Testing by default.
steps:
- uses: browser-actions/setup-chrome@v2
- run: chrome --versionTo install a specific channel, use chrome-version input.
steps:
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: 120The action support installing the compatible ChromeDriver with the browser.
You can use the install-chromedriver to install the ChromeDriver.
steps:
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: 120
install-chromedriver: trueIf you use the self-hosted runner, your runner may not have the required dependencies on the system.
You can install the dependencies by using the install-dependencies parameter.
It installs the required dependencies for the Google Chrome/Chromium to run automatically.
steps:
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: 120
install-dependencies: true| Version format | Example | Download source |
|---|---|---|
| Channel name | stable (default), beta, dev, canary |
Chrome for Testing |
| Commit position | 1295939 |
Chromium Snapshots |
| Specific version | 119, 120.0.6099, 121.0.6100.0 |
Chrome for Testing |
| Latest snapshot | latest |
Chromium Snapshots |
You can find Chromium commit positions from here.
The installed binary name is not always chrome or chromium.
It depends on your installation spec and OS.
To get the installed binary path, use chrome-path output of the action:
steps:
- uses: browser-actions/setup-chrome@v2
id: setup-chrome
- run: |
${{ steps.setup-chrome.outputs.chrome-path }} --version| Linux x64 | Linux ARM32 | Linux ARM64 | macOS x64 | macOS ARM64 | Windows x64 | Windows ARM64 | |
|---|---|---|---|---|---|---|---|
| Channel name | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| Commit position | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| Specific version | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| Latest snapshot | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
chrome-version: (Optional) The Google Chrome/Chromium version to be installed. Default:latestinstall-dependencies: (Optional) Install the required dependencies for the Google Chrome/Chromium to run. Default:falseinstall-chromedriver: (Optional) Install the compatible ChromeDriver with the browser. Default:falseno-sudo: (Optional) Do not use sudo to install Google Chrome/Chromium (Linux only). Default:false
chrome-path: The installed Google Chrome/Chromium binary path.chrome-version: The installed Google Chrome/Chromium version.chromedriver-path: The installed ChromeDriver binary path.chromedriver-version: The installed ChromeDriver version.
See CONTRIBUTING.md for development setup, workflow, and release process.