Skip to content

Commit a51621d

Browse files
authored
Merge pull request #223 from KubrickCode/develop/shlee/200-3
refactor(ci): extract common CI setup to composite action
2 parents 24dc3b0 + 761aafc commit a51621d

File tree

2 files changed

+47
-40
lines changed

2 files changed

+47
-40
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Setup Environment"
2+
description: "Setup Node.js, pnpm, and just for CI workflows"
3+
4+
inputs:
5+
enable-turbo-cache:
6+
description: "Enable turbo cache"
7+
required: false
8+
default: "false"
9+
cache-suffix:
10+
description: "Suffix for cache key differentiation"
11+
required: false
12+
default: ""
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Setup Node 22
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version: "22.18.0"
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9.15.0
26+
27+
- name: Setup just
28+
uses: extractions/setup-just@v3
29+
30+
- name: Cache turbo
31+
if: inputs.enable-turbo-cache == 'true'
32+
uses: actions/cache@v4
33+
with:
34+
path: .turbo
35+
key: turbo-${{ inputs.cache-suffix }}-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
36+
restore-keys: |
37+
turbo-${{ inputs.cache-suffix }}-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
38+
turbo-${{ inputs.cache-suffix }}-${{ runner.os }}-

.github/workflows/test.yml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,11 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@master
3333

34-
- name: Setup Node 22
35-
uses: actions/setup-node@v6
36-
with:
37-
node-version: "22.18.0"
38-
39-
- name: Setup pnpm
40-
uses: pnpm/action-setup@v4
34+
- name: Setup environment
35+
uses: ./.github/actions/setup-env
4136
with:
42-
version: 9.15.0
43-
44-
- uses: extractions/setup-just@v3
45-
46-
- name: Cache turbo
47-
uses: actions/cache@v4
48-
with:
49-
path: .turbo
50-
key: turbo-test-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
51-
restore-keys: |
52-
turbo-test-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
53-
turbo-test-${{ runner.os }}-
37+
enable-turbo-cache: "true"
38+
cache-suffix: "test"
5439

5540
- name: Install dependencies
5641
run: just deps-compact
@@ -118,17 +103,8 @@ jobs:
118103
- name: Checkout
119104
uses: actions/checkout@master
120105

121-
- name: Setup Node 22
122-
uses: actions/setup-node@v6
123-
with:
124-
node-version: "22.18.0"
125-
126-
- name: Setup pnpm
127-
uses: pnpm/action-setup@v4
128-
with:
129-
version: 9.15.0
130-
131-
- uses: extractions/setup-just@v3
106+
- name: Setup environment
107+
uses: ./.github/actions/setup-env
132108

133109
- name: Install dependencies
134110
run: just deps
@@ -161,17 +137,10 @@ jobs:
161137
- name: Checkout
162138
uses: actions/checkout@master
163139

164-
- name: Setup Node 22
165-
uses: actions/setup-node@v6
166-
with:
167-
node-version: "22.18.0"
168-
169-
- name: Setup pnpm
170-
uses: pnpm/action-setup@v4
171-
with:
172-
version: 9.15.0
140+
- name: Setup environment
141+
uses: ./.github/actions/setup-env
173142

174-
- name: Install Playwright
143+
- name: Install view dependencies
175144
run: cd src/view && pnpm install
176145

177146
- name: Download all blob reports

0 commit comments

Comments
 (0)