How to install Google Chrome browser in GitHub Actions workflow?

In Travis CI there’s this:

addons:
chrome: stable

which installs the latest stable Chrome, that is used for e2e tests of a web app with Selenium.

What’s the correct way of setting up the same in GitHub Actions? I have tried using:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome*.deb

 and 

-uses: nanasess/setup-chromedriver@master

but it does not work.

For reference, here’s the public repo: https://github.com/bolt/core

Any suggestions?

Hi @i-valchev,

It’s already installed on our default images. I haven’t tried it myself, but can see it’s listed here: https://github.com/actions/virtual-environments/blob/ffa2110464ecda1cc62b477f29609525de24e570/images/linux/Ubuntu1804-README.md (search Chrome). 

Hi @mscoutermarsh , when I try to run e2e tests with Behat and Selenium, it spits out this:

#0 /home/runner/work/core/core/vendor/behat/mink/src/Element/DocumentElement.php(37): Behat\Mink\Driver\Selenium2Driver->getContent()
#1 /home/runner/work/core/core/vendor/behatch/contexts/src/HttpCall/HttpCallListener.php(55): Behat\Mink\Element\DocumentElement->getContent()
#2 /home/runner/work/core/core/vendor/symfony/event-dispatcher/EventDispatcher.php(264): Behatch\HttpCall\HttpCallListener->afterStep()
#3 /home/runner/work/core/core/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcherSymfonyLegacy.php(36): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
#4 /home/runner/work/core/core/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php(107): Behat\Testwork\EventDispatcher\TestworkEventDispatcherSymfonyLegacy->dispatch()
#5 /home/runner/work/core/core/vendor/behat/ in /home/runner/work/core/core/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php on line 487

which should mean it cannot find chrome/chrome driver. But the thing is, the exact same setup works with Travis using the add-on option I posted earlier. Any ideas how to resolve this?

Right, the source() error is becuse of a mismatch between the chromedriver and the installed Chrome version.

I know that by default both are installed on GitHub Actions, but they seem out of date - currently installed version is 81, but the latest stable Chrome is 83.

Is there a way to guarantee that, for example, my e2e tests are always run against the latest stable Chrome release?