From 978d848b3989755e728353542714915782fc12c0 Mon Sep 17 00:00:00 2001 From: zomars Date: Mon, 20 Feb 2023 19:37:19 -0700 Subject: [PATCH] Cleanup --- .github/actions/cache-install/action.yml | 19 ------------------- .github/actions/cache-playwright/action.yml | 14 -------------- .github/actions/yarn-build/action.yml | 14 ++++++++++++-- .github/actions/yarn-install/action.yml | 5 ----- .../yarn-playwright-install/action.yml | 12 ++++++++++-- .github/workflows/e2e-app-store.yml | 2 +- .github/workflows/e2e-embed.yml | 2 +- .github/workflows/pr.yml | 3 +-- .github/workflows/yarn-e2e.yml | 2 +- 9 files changed, 26 insertions(+), 47 deletions(-) delete mode 100644 .github/actions/cache-install/action.yml delete mode 100644 .github/actions/cache-playwright/action.yml diff --git a/.github/actions/cache-install/action.yml b/.github/actions/cache-install/action.yml deleted file mode 100644 index 645c777ead..0000000000 --- a/.github/actions/cache-install/action.yml +++ /dev/null @@ -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 }}- diff --git a/.github/actions/cache-playwright/action.yml b/.github/actions/cache-playwright/action.yml deleted file mode 100644 index 6cd8e26ee4..0000000000 --- a/.github/actions/cache-playwright/action.yml +++ /dev/null @@ -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- diff --git a/.github/actions/yarn-build/action.yml b/.github/actions/yarn-build/action.yml index 3449dd6b98..afc23cf8e5 100644 --- a/.github/actions/yarn-build/action.yml +++ b/.github/actions/yarn-build/action.yml @@ -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 diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index 6c43e81094..e252a5d1e1 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -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' diff --git a/.github/actions/yarn-playwright-install/action.yml b/.github/actions/yarn-playwright-install/action.yml index e21cb03371..65a093bfe2 100644 --- a/.github/actions/yarn-playwright-install/action.yml +++ b/.github/actions/yarn-playwright-install/action.yml @@ -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 diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml index f49331a503..dd7e7c0c0b 100644 --- a/.github/workflows/e2e-app-store.yml +++ b/.github/workflows/e2e-app-store.yml @@ -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 diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml index 78c17c90b7..d277f5f96c 100644 --- a/.github/workflows/e2e-embed.yml +++ b/.github/workflows/e2e-embed.yml @@ -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 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e0d9ab7c2a..684dc3f7a7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 diff --git a/.github/workflows/yarn-e2e.yml b/.github/workflows/yarn-e2e.yml index b234796ae9..c2452678fe 100644 --- a/.github/workflows/yarn-e2e.yml +++ b/.github/workflows/yarn-e2e.yml @@ -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