Skip to content

Commit 5c0c611

Browse files
refactor: make CI do less unneeded work (#11372)
Co-authored-by: Pete Bacon Darwin <[email protected]>
1 parent 227e712 commit 5c0c611

10 files changed

+38
-16
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
node-version:
55
description: the version of Node.js to install
66
default: 20.19.1
7+
pnpm-filters:
8+
description: space-separated list of pnpm filters to apply (e.g., "wrangler miniflare")
9+
default: ""
710
turbo-api:
811
description: the api URL for connecting to the turbo remote cache
912
turbo-team:
@@ -40,7 +43,17 @@ runs:
4043
4144
- name: Install NPM Dependencies
4245
shell: bash
43-
run: pnpm install --frozen-lockfile
46+
# Still install the root dependencies even if filters are provided.
47+
# Some packages may depend on root-level packages.
48+
run: |
49+
FILTERS=""
50+
if [ -n "${{ inputs.pnpm-filters }}" ]; then
51+
FILTERS="--filter ./"
52+
for filter in ${{ inputs.pnpm-filters }}; do
53+
FILTERS="$FILTERS --filter $filter"
54+
done
55+
fi
56+
pnpm install --frozen-lockfile $FILTERS
4457
4558
- name: Install uv for Python
4659
uses: astral-sh/setup-uv@v6

.github/workflows/auto-assign-issues.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,10 @@ jobs:
1616
- name: Checkout repository
1717
uses: actions/checkout@v4
1818

19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
19+
- uses: ./.github/actions/install-dependencies
2120
with:
2221
node-version: 22 # need this version for `Set` methods
23-
24-
- name: Install pnpm
25-
uses: pnpm/action-setup@v4
26-
with:
27-
version: 9.12.0
28-
29-
- name: Install Dependencies
30-
run: pnpm i -F tools --frozen-lockfile
22+
pnpm-filters: "./tools"
3123

3224
- name: Auto-assign issue
3325
run: node -r esbuild-register tools/github-workflow-helpers/auto-assign-issues.ts

.github/workflows/c3-dependabot-versioning-prs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ jobs:
2121
fetch-depth: 2
2222
ref: ${{ github.head_ref }}
2323
token: ${{ secrets.GH_ACCESS_TOKEN }}
24+
2425
- name: Install Dependencies
2526
uses: ./.github/actions/install-dependencies
27+
with:
28+
pnpm-filters: "./tools"
29+
2630
- name: Configure Git
2731
run: |
2832
git config --global user.email [email protected]

.github/workflows/e2e-project-cleanup.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424

2525
- name: Install Dependencies
2626
uses: ./.github/actions/install-dependencies
27+
with:
28+
pnpm-filters: "./tools"
2729

2830
- name: Cleanup E2E test projects
2931
run: node -r esbuild-register tools/e2e/e2eCleanup.ts

.github/workflows/miniflare-dependabot-versioning-prs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525

2626
- name: Install Dependencies
2727
uses: ./.github/actions/install-dependencies
28+
with:
29+
pnpm-filters: "./tools"
2830

2931
- name: Configure Git
3032
run: |

.github/workflows/open-v3-maintenance-prs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333

3434
- name: Install Dependencies
3535
uses: ./.github/actions/install-dependencies
36+
with:
37+
pnpm-filters: "./tools"
3638

3739
- uses: Ana06/[email protected]
3840
id: files

.github/workflows/prerelease.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- name: Install Dependencies
3131
uses: ./.github/actions/install-dependencies
3232
with:
33+
pnpm-filters: "./packages/*"
3334
turbo-api: ${{ secrets.TURBO_API }}
3435
turbo-team: ${{ secrets.TURBO_TEAM }}
3536
turbo-token: ${{ secrets.TURBO_TOKEN }}

.github/workflows/validate-pr-description.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ jobs:
4040
everything_but_markdown:
4141
- '!**/*.md'
4242
43-
- uses: Ana06/[email protected]
44-
id: files
45-
with:
46-
format: "json"
47-
4843
- name: Install Dependencies
4944
if: steps.changes.outputs.everything_but_markdown == 'true'
5045
uses: ./.github/actions/install-dependencies
@@ -54,6 +49,13 @@ jobs:
5449
turbo-token: ${{ secrets.TURBO_TOKEN }}
5550
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
5651

52+
- name: List changed files
53+
if: steps.changes.outputs.everything_but_markdown == 'true'
54+
id: files
55+
uses: Ana06/[email protected]
56+
with:
57+
format: "json"
58+
5759
- run: node -r esbuild-register tools/deployments/validate-pr-description.ts
5860
if: steps.changes.outputs.everything_but_markdown == 'true'
5961
env:

.github/workflows/workers-shared-deploy-production.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- name: Checkout repo
1515
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
1618

1719
- name: Install Dependencies
1820
uses: ./.github/actions/install-dependencies

.github/workflows/workers-shared-deploy-staging.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: "Checkout repo"
1919
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 1
2022

2123
- name: Install Dependencies
2224
uses: ./.github/actions/install-dependencies

0 commit comments

Comments
 (0)