Skip to content

Commit 5501ed8

Browse files
ci: consolidate "install dependencies" into an action
1 parent 04be59b commit 5501ed8

File tree

4 files changed

+32
-40
lines changed

4 files changed

+32
-40
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Install Dependencies"
2+
description: "Install dependencies, fetching from cache when possible"
3+
inputs:
4+
node-version:
5+
description: the version of Node.js to install
6+
default: 20.18.0
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Install pnpm
12+
uses: pnpm/action-setup@v4
13+
with:
14+
version: 9
15+
16+
- name: Install Node.js ${{ inputs.node-version }}
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ inputs.node-version }}
20+
cache: "pnpm"
21+
registry-url: "https://registry.npmjs.org"
22+
23+
- name: Install NPM Dependencies
24+
shell: bash
25+
run: pnpm install --frozen-lockfile

.github/workflows/checks.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,8 @@ jobs:
1818
- name: Check out code
1919
uses: actions/checkout@v4
2020

21-
- name: Setup pnpm
22-
uses: pnpm/action-setup@v4
23-
with:
24-
version: 9
25-
26-
- name: Setup Node.js environment
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: 20
30-
cache: "pnpm"
31-
32-
- name: Install dependencies
33-
run: pnpm install --frozen-lockfile
21+
- name: Install Dependencies
22+
uses: ./.github/actions/install-dependencies
3423

3524
- name: ${{ matrix.script }}
3625
run: pnpm run ${{ matrix.script }}

.github/workflows/playwright.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,11 @@ jobs:
1414
- name: Check out code
1515
uses: actions/checkout@v4
1616

17-
- name: Setup pnpm
18-
uses: pnpm/action-setup@v4
19-
with:
20-
version: 9
17+
- name: Install Dependencies
18+
uses: ./.github/actions/install-dependencies
2119

22-
- name: Setup Node.js environment
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 20
26-
cache: "pnpm"
27-
28-
- name: Install dependencies
29-
run: |
30-
pnpm install --frozen-lockfile
31-
pnpm run install-playwright
20+
- name: Install Playwright
21+
run: pnpm run install-playwright
3222

3323
- name: Build all workers
3424
run: pnpm -r build:worker

.github/workflows/prereleases.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,8 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616

17-
- name: Install pnpm
18-
uses: pnpm/action-setup@v4
19-
with:
20-
version: 9.10.0
21-
22-
- name: Install Node.js 20
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 20
26-
cache: "pnpm"
27-
registry-url: "https://registry.npmjs.org"
28-
2917
- name: Install Dependencies
30-
run: pnpm i --frozen-lockfile
18+
uses: ./.github/actions/install-dependencies
3119

3220
- name: Build
3321
run: pnpm -F cloudflare run build

0 commit comments

Comments
 (0)