[INFRA] Cache browsers installed by playwright when running GH workflows #2356
Labels
chore
Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)
Milestone
Playwright uses specific versions of these browsers (including patched versions of Firefox and Webkit) and the versions change with the version of Playwright.
Today, we are installing a fresh browser when it is needed. This means that we are downloading the same browser multiple times. It is time consuming and consumes a lot of bandwidth.
Here are typical size of the installed browsers (always more than 200MB)
Instead, we could download the browser once and cache it. Notice that the downloaded browser depends on the OS.
Playwright allows to download the browser in specific location. This may help to cache the directory
The node_modules folder is interesting as we already cache it. However, we must cache various flavors of the same browser for each OS.
For a dedicated folder the cache could be named with
If we change the path were the browsers are stored, remember that the path must be passed when running tests. Path configuration is done by setting environment variables.
See also #2355 for other improvements about playwright browser management in GitHub workflows.
The text was updated successfully, but these errors were encountered: