Abstract playwright cache

pull/7267/head
zomars 2023-02-20 15:53:04 -07:00
parent e92ad12b54
commit f82833cfdb
5 changed files with 27 additions and 58 deletions

View File

@ -0,0 +1,23 @@
name: Install playwright binaries
description: "Install playwright, cache and restore if necessary"
inputs:
node_version:
required: true
description: "The node version used to run this"
runs:
using: "composite"
steps:
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
shell: bash
run: yarn playwright install

View File

@ -76,21 +76,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- uses: ./.github/actions/cache-playwright
- name: Run Tests
run: yarn test-e2e:app-store

View File

@ -72,21 +72,7 @@ jobs:
with:
node-version: 16.x
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- uses: ./.github/actions/cache-playwright
- name: Run Tests
run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1

View File

@ -75,21 +75,7 @@ jobs:
with:
node-version: 16.x
cache: "yarn"
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- run: yarn --frozen-lockfile
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- uses: ./.github/actions/cache-playwright
- run: yarn test-e2e
- name: Upload test results

View File

@ -65,19 +65,7 @@ jobs:
- uses: ./.github/actions/yarn-install
with:
node_version: ${{ secrets.node_version }}
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-
- name: Install playwright deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install
- uses: ./.github/actions/cache-playwright
- uses: ./.github/actions/yarn-build
with:
# GitHub Composite actions cannot read secrets, we have to pass them in here