From b4790dd2aa052d9f1e24b210c9625f6fcc44112d Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Tue, 30 Dec 2025 14:44:23 -0300 Subject: [PATCH] refactor: move deps job to prepare job step to save ~20s per workflow (#26320) * refactor: move deps job to prepare job step to save ~10s per workflow Co-Authored-By: keith@cal.com * chore: remove unused yarn-install.yml workflow Co-Authored-By: keith@cal.com --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/pr.yml | 36 ++++++++++++++++-------------- .github/workflows/yarn-install.yml | 22 ------------------ 2 files changed, 19 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/yarn-install.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 825d7cd286e2b4..06dc5e2b8d10b4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -242,44 +242,46 @@ jobs: const labelFound = labels.map(l => l.name).includes('ready-for-e2e'); console.log('Found the label?', labelFound); core.setOutput('run-e2e', labelFound); - - deps: - name: Install dependencies - needs: [prepare] - if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} - uses: ./.github/workflows/yarn-install.yml + - uses: ./.github/actions/yarn-install + if: ${{ steps.filter.outputs.has-files-requiring-all-checks == 'true' }} + with: + skip-install-if-cache-hit: "true" + - uses: ./.github/actions/yarn-playwright-install + if: ${{ steps.filter.outputs.has-files-requiring-all-checks == 'true' }} + with: + skip-install-if-cache-hit: "true" type-check: name: Type check - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/check-types.yml secrets: inherit lint: name: Linters - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/lint.yml secrets: inherit unit-test: name: Tests - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/unit-tests.yml secrets: inherit api-v2-unit-test: name: Tests - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/api-v2-unit-tests.yml secrets: inherit setup-db: name: Setup Database - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/setup-db.yml with: @@ -288,28 +290,28 @@ jobs: build-api-v1: name: Production builds - needs: [prepare, deps, setup-db] + needs: [prepare, setup-db] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/api-v1-production-build.yml secrets: inherit build-api-v2: name: Production builds - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/api-v2-production-build.yml secrets: inherit build-atoms: name: Production builds - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/atoms-production-build.yml secrets: inherit build-docs: name: Production builds - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/docs-build.yml secrets: inherit @@ -323,7 +325,7 @@ jobs: build: name: Production builds - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/production-build-without-database.yml secrets: inherit @@ -344,7 +346,7 @@ jobs: check-api-v2-breaking-changes: name: Check API v2 breaking changes - needs: [prepare, deps] + needs: [prepare] if: ${{ needs.prepare.outputs.run-e2e == 'true' && needs.prepare.outputs.has-files-requiring-all-checks == 'true' }} uses: ./.github/workflows/check-api-v2-breaking-changes.yml secrets: inherit diff --git a/.github/workflows/yarn-install.yml b/.github/workflows/yarn-install.yml deleted file mode 100644 index e9e4c6ca5935eb..00000000000000 --- a/.github/workflows/yarn-install.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Yarn install - -on: - workflow_call: - -permissions: - contents: read - -jobs: - setup: - name: Yarn install & cache - runs-on: blacksmith-2vcpu-ubuntu-2404 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/dangerous-git-checkout - - uses: ./.github/actions/yarn-install - with: - skip-install-if-cache-hit: "true" - - uses: ./.github/actions/yarn-playwright-install - with: - skip-install-if-cache-hit: "true"