nanasess/setup-chromedriver
ChromeDriver for use in GitHub Actions
π setup-chromedriver
A GitHub Action to set up ChromeDriver for automated testing
Features β’ Quick Start β’ Usage β’ Platform Support β’ Configuration β’ Examples β’ Contributing
β¨ Features
- π§ Automatic Version Matching - Automatically installs ChromeDriver that matches your Chrome browser version
- π₯οΈ Cross-Platform - Works on Ubuntu, macOS, and Windows
- β‘ Fast Setup - Quick installation with minimal configuration
- π― Version Control - Option to specify exact ChromeDriver version
- π οΈ Custom Chrome Binary - Support for custom Chrome binary names
π Quick Start
Add this step to your workflow to automatically set up ChromeDriver:
- uses: nanasess/setup-chromedriver@v2That's it! ChromeDriver will be installed and added to your PATH.
π Usage
Basic Usage
The simplest way to use this action is without any parameters. It will automatically detect your Chrome version and install the matching ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- run: chromedriver --versionSpecify ChromeDriver Version
If you need a specific version of ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '131.0.6778.87'
- run: chromedriver --versionCustom Chrome Binary
If your Chrome binary has a custom name:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
with:
chromeapp: chrome-betaπ₯οΈ Platform Support
| Platform | Versions |
|---|---|
| Ubuntu | ubuntu-latest, ubuntu-24.04, ubuntu-22.04 |
| macOS | macos-latest, macos-15, macos-14 |
| Windows | windows-latest, windows-2025 , windows-2022 |
βοΈ Configuration
Input Parameters
| Parameter | Description | Required | Default |
|---|---|---|---|
chromedriver-version |
The ChromeDriver version to install | No | Auto-detected |
chromeapp |
Custom Chrome binary name (Linux/macOS only) | No | System default |
π Examples
Running Tests on Ubuntu/macOS with Xvfb
name: UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Start ChromeDriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Run tests
run: npm testRunning Tests on Windows
name: Windows UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Start ChromeDriver
run: chromedriver --url-base=/wd/hub &
- name: Run tests
run: npm testMatrix Testing Across Platforms
name: Cross-Platform Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Run tests
run: npm testTesting with Specific Chrome Version
name: Chrome Version Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: '131'
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '131.0.6778.87'
- name: Run tests
run: npm testπ€ Contributing
Contributions are welcome! Here's how you can help:
- π΄ Fork the repository
- π§ Create your feature branch (
git checkout -b feature/amazing-feature) - π» Make your changes
- β
Run tests with
yarn test - π Commit your changes (
git commit -m 'Add amazing feature') - π€ Push to the branch (
git push origin feature/amazing-feature) - π Open a Pull Request
Development Setup
# Install dependencies
yarn install --frozen-lockfile
# Build the action
yarn build
yarn package
# Run tests
yarn test
# Format code
yarn formatFor more details on the architecture and development process, see CLAUDE.md.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Thanks to all contributors who have helped improve this action
- Special thanks to the ChromeDriver team for their excellent work
π Support
If you find this action helpful, please consider:
- β Starring the repository
- π¬ Sharing it with others who might benefit
- π° Sponsoring the maintainer
Made with β€οΈ by @nanasess