1
- name : " Install Playwright dependencies"
2
- description : " Installs Playwright dependencies and caches them."
1
+ name : ' Install Playwright dependencies'
2
+ description : ' Installs Playwright dependencies and caches them.'
3
3
inputs :
4
4
browsers :
5
5
description : ' What browsers to install.'
@@ -9,41 +9,42 @@ inputs:
9
9
default : ' .'
10
10
11
11
runs :
12
- using : " composite"
12
+ using : ' composite'
13
13
steps :
14
- - name : Get Playwright version
15
- id : playwright-version
16
- run : echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
17
- shell : bash
18
- working-directory : ${{ inputs.cwd }}
14
+ - name : Get Playwright version
15
+ id : playwright-version
16
+ run : echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
17
+ shell : bash
18
+ working-directory : ${{ inputs.cwd }}
19
19
20
+ - name : Restore cached playwright binaries
21
+ uses : actions/cache/restore@v4
22
+ id : playwright-cache
23
+ with :
24
+ path : |
25
+ ~/.cache/ms-playwright
26
+ # Bump the iteration when bumping runner images to use a new cache
27
+ key : playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
20
28
21
- - name : Restore cached playwright binaries
22
- uses : actions/cache/restore@v4
23
- id : playwright-cache
24
- with :
25
- path : |
26
- ~/.cache/ms-playwright
27
- key : playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
29
+ # We always install all browsers, if uncached
30
+ - name : Install Playwright dependencies (uncached)
31
+ run : npx playwright install chromium webkit firefox --with-deps
32
+ if : steps.playwright-cache.outputs.cache-hit != 'true'
33
+ shell : bash
34
+ working-directory : ${{ inputs.cwd }}
28
35
29
- # We always install all browsers, if uncached
30
- - name : Install Playwright dependencies (uncached)
31
- run : npx playwright install chromium webkit firefox --with-deps
32
- if : steps.playwright-cache.outputs.cache-hit != 'true'
33
- shell : bash
34
- working-directory : ${{ inputs.cwd }}
36
+ - name : Install Playwright system dependencies only (cached)
37
+ run : npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
38
+ if : steps.playwright-cache.outputs.cache-hit == 'true'
39
+ shell : bash
40
+ working-directory : ${{ inputs.cwd }}
35
41
36
- - name : Install Playwright system dependencies only (cached)
37
- run : npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
38
- if : steps.playwright-cache.outputs.cache-hit == 'true'
39
- shell : bash
40
- working-directory : ${{ inputs.cwd }}
41
-
42
- # Only store cache on develop branch
43
- - name : Store cached playwright binaries
44
- uses : actions/cache/save@v4
45
- if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
46
- with :
47
- path : |
48
- ~/.cache/ms-playwright
49
- key : playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
42
+ # Only store cache on develop branch
43
+ - name : Store cached playwright binaries
44
+ uses : actions/cache/save@v4
45
+ if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
46
+ with :
47
+ path : |
48
+ ~/.cache/ms-playwright
49
+ # Bump the iteration when bumping runner images to use a new cache
50
+ key : playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
0 commit comments