Skip to content

Scheduling infrastructure for absolutely everyone.

refactor: move deps job to prepare job step to save ~20s per workflow (#26320)

Keith Williamsb4790dd2aa05
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 825d7cd286e..06dc5e2b8d1 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 e9e4c6ca593..00000000000
--- 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"