diff --git a/.github/actions/cache-build/action.yml b/.github/actions/cache-build/action.yml index 26060a85c3..7d6605058d 100644 --- a/.github/actions/cache-build/action.yml +++ b/.github/actions/cache-build/action.yml @@ -13,14 +13,16 @@ runs: env: cache-name: prod-build key-1: ${{ inputs.node_version }}-${{ hashFiles('yarn.lock') }} - key-2: ${{ hashFiles('**/**.[jt]s', '**/**.[jt]sx', '!**/node_modules') }} + key-2: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', '!**/node_modules') }} key-3: ${{ github.event.pull_request.number || github.ref }} + # Ensures production-build.yml will always be fresh + key-4: ${{ github.sha }} with: path: | ${{ github.workspace }}/apps/web/.next **/.turbo/** **/dist/** - key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }} - run: yarn build if: steps.cache-build.outputs.cache-hit != 'true' shell: bash diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index 4dbb7c5f8c..d6ae98b4bd 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -12,17 +12,6 @@ runs: with: node-version: ${{ inputs.node_version }} cache: "yarn" - - 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', 'packages/prisma/schema.prisma') }} - with: - path: | - **/node_modules/** - packages/prisma/zod - key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-key }} - name: Yarn install shell: bash run: | diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml index e3d883bb9e..c1d32aaa7b 100644 --- a/.github/workflows/e2e-app-store.yml +++ b/.github/workflows/e2e-app-store.yml @@ -22,8 +22,8 @@ jobs: - run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install - - uses: ./.github/actions/cache-db - uses: ./.github/actions/env-read-file + - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests run: yarn test-e2e:app-store diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml index db1f6707aa..bb24e4c100 100644 --- a/.github/workflows/e2e-embed.yml +++ b/.github/workflows/e2e-embed.yml @@ -21,8 +21,8 @@ jobs: - run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install - - uses: ./.github/actions/cache-db - uses: ./.github/actions/env-read-file + - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests run: yarn turbo run embed-tests-update-snapshots:ci --scope=@calcom/embed-react --concurrency=1 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c77054f275..95e82b24c2 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -20,8 +20,8 @@ jobs: - run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV - uses: ./.github/actions/yarn-install - uses: ./.github/actions/yarn-playwright-install - - uses: ./.github/actions/cache-db - uses: ./.github/actions/env-read-file + - uses: ./.github/actions/cache-db - uses: ./.github/actions/cache-build - name: Run Tests run: yarn test-e2e diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e306a557eb..c7c3159bf4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -37,32 +37,24 @@ jobs: uses: ./.github/workflows/env-create-file.yml secrets: inherit - setup: - name: Yarn install & cache - uses: ./.github/workflows/yarn-install.yml - secrets: inherit - type-check: name: Type check - needs: setup uses: ./.github/workflows/check-types.yml secrets: inherit test: name: Unit tests - needs: setup uses: ./.github/workflows/test.yml secrets: inherit lint: name: Linters - needs: setup uses: ./.github/workflows/lint.yml secrets: inherit build: name: Production build - needs: [setup, env] + needs: env uses: ./.github/workflows/production-build.yml secrets: inherit