-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
action.yml
63 lines (56 loc) · 2.26 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Setup and cache
description: Setup for node, pnpm and cache for browser testing binaries
inputs:
node-version:
required: false
description: Node version for setup-node
default: 18.x
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set node version to ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Resolve package versions
id: resolve-package-versions
shell: bash
run: >
echo "$(
node -e "
const fs = require('fs');
const lockfile = fs.readFileSync('./pnpm-lock.yaml', 'utf8');
const cypressVersion = lockfile.match(/cypress: (\d+\.\d+\.\d+)/)[1];
const playwrightVersion = lockfile.match(/playwright: (\d+\.\d+\.\d+)/)[1];
const puppeteerVersion = lockfile.match(/puppeteer: (\d+\.\d+\.\d+)/)[1];
console.log('CYPRESS_VERSION=' + cypressVersion);
console.log('PLAYWRIGHT_VERSION=' + playwrightVersion);
console.log('PUPPETEER_VERSION=' + puppeteerVersion);
"
)" >> $GITHUB_OUTPUT
- name: Cache Cypress v${{ steps.resolve-package-versions.outputs.CYPRESS_VERSION }}
uses: actions/cache@v3
id: cypress-cache
with:
path: ${{ env.CYPRESS_CACHE_FOLDER }}
key: ${{ runner.os }}-cypress-${{ steps.resolve-package-versions.outputs.CYPRESS_VERSION }}
restore-keys: |
${{ runner.os }}-cypress-
- name: Cache Playwright v${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
uses: actions/cache@v3
id: playwright-cache
with:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
key: ${{ runner.os }}-playwright-${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Cache Puppeteer v${{ steps.resolve-package-versions.outputs.PUPPETEER_VERSION }}
uses: actions/cache@v3
id: puppeteer-cache
with:
path: ${{ env.PUPPETEER_DOWNLOAD_PATH }}
key: ${{ runner.os }}-puppeteer-${{ steps.resolve-package-versions.outputs.PUPPETEER_VERSION }}
restore-keys: |
${{ runner.os }}-puppeteer-