pull/7267/head
zomars 2023-02-20 19:37:19 -07:00
parent f2ccee16a7
commit 978d848b39
9 changed files with 26 additions and 47 deletions

View File

@ -1,19 +0,0 @@
name: Yarn cache
description: "Caches all NPM dependencies or restores if necessary"
inputs:
node_version:
required: true
description: "The node version used to run this"
runs:
using: "composite"
steps:
- name: node_modules cache
id: node-modules-cache
uses: actions/cache@v3
env:
cache-name: node-modules-yarn
cache-key: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }}
with:
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-key }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-

View File

@ -1,14 +0,0 @@
name: Cache playwright binaries
description: "Cache playwright or restore if necessary"
runs:
using: "composite"
steps:
- name: Cache playwright binaries
uses: actions/cache@v2
with:
path: |
~/Library/Caches/ms-playwright
~/.cache/ms-playwright
${{ github.workspace }}/node_modules/playwright
key: cache-playwright-${{ hashFiles('**/yarn.lock') }}
restore-keys: cache-playwright-

View File

@ -71,10 +71,20 @@ runs:
- uses: ./.github/actions/yarn-install
with:
node_version: ${{ inputs.node_version }}
- uses: ./.github/actions/cache-build
- name: Cache production build
id: prod-build-cache
uses: actions/cache@v3
env:
cache-name: prod-build
key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/web/next.config.js') }}
with:
node_version: ${{ inputs.node_version }}
path: |
apps/web/.next
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-
- name: Next.js production build
if: steps.prod-build-cache.outputs.cache-hit != 'true'
shell: bash

View File

@ -17,11 +17,6 @@ runs:
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-key }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-
# Testing if this is slower
# - uses: ./.github/actions/cache-install
# id: node-modules-cache
# with:
# node_version: ${{ inputs.node_version }}
- name: Yarn install
shell: bash
if: steps.node-modules-cache.outputs.cache-hit != 'true'

View File

@ -3,9 +3,17 @@ description: "Install playwright, cache and restore if necessary"
runs:
using: "composite"
steps:
- uses: ./.github/actions/cache-playwright
- name: Cache playwright binaries
id: playwright-cache
- name: Yarn install
uses: actions/cache@v2
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: Yarn playwright install
shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install

View File

@ -76,7 +76,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- uses: ./.github/actions/cache-playwright
- uses: ./.github/actions/yarn-playwright-install
- name: Run Tests
run: yarn test-e2e:app-store

View File

@ -72,7 +72,7 @@ jobs:
with:
node-version: 16.x
cache: "yarn"
- uses: ./.github/actions/cache-playwright
- uses: ./.github/actions/yarn-playwright-install
- name: Run Tests
run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1

View File

@ -38,7 +38,7 @@ jobs:
needs: setup
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/cache-install
- uses: ./.github/actions/yarn-install
with:
node_version: ${{ secrets.NODE_VERSION }}
- run: yarn lint
@ -70,7 +70,6 @@ jobs:
with:
node_version: ${{ env.node_version }}
- uses: ./.github/actions/cache-build
id: prod-build-cache
with:
node_version: ${{ env.node_version }}
# Here's the first place where next-bundle-analysis' own script is used

View File

@ -66,7 +66,7 @@ jobs:
- uses: ./.github/actions/yarn-install
with:
node_version: ${{ secrets.node_version }}
- uses: ./.github/actions/cache-playwright
- uses: ./.github/actions/yarn-playwright-install
- uses: ./.github/actions/yarn-build
with:
# GitHub Composite actions cannot read secrets, we have to pass them in here