Skip to content

Commit 2260c4e

Browse files
authored
ci: refactor to use shared actions (#1315)
1 parent 3f8b514 commit 2260c4e

File tree

1 file changed

+16
-100
lines changed

1 file changed

+16
-100
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,11 @@ jobs:
1515
- name: Checkout Repository
1616
uses: actions/checkout@v3
1717

18-
- name: Install Node
19-
uses: actions/setup-node@v3
18+
- uses: the-guild-org/shared-config/setup@main
19+
name: Setup Env
2020
with:
21-
node-version: 16
22-
23-
- name: Install pnpm
24-
uses: pnpm/[email protected]
25-
with:
26-
version: 8
27-
28-
- name: Get pnpm store path
29-
id: pnpm-store
30-
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
31-
32-
- name: Cache pnpm
33-
uses: actions/cache@v3
34-
with:
35-
path: ${{ steps.pnpm-store.outputs.PATH }}
36-
key:
37-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
38-
hashFiles('**/pnpm-lock.yaml') }}
39-
restore-keys: |
40-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
41-
42-
- name: Install Dependencies
43-
run: pnpm i
21+
nodeVersion: 18
22+
packageManager: pnpm
4423

4524
- name: Lint
4625
run: pnpm lint
@@ -58,38 +37,17 @@ jobs:
5837
- name: Checkout Repository
5938
uses: actions/checkout@v3
6039

61-
- name: Install Node
62-
uses: actions/setup-node@v3
40+
- uses: the-guild-org/shared-config/setup@main
41+
name: Setup Env
6342
with:
64-
node-version: ${{ matrix.node-version }}
65-
66-
- name: Install pnpm
67-
uses: pnpm/[email protected]
68-
with:
69-
version: 8
43+
nodeVersion: 18
44+
packageManager: pnpm
7045

7146
- name: Setup git user information
7247
run: |
7348
git config --global user.name "$(git log -n 1 --pretty=format:%an)"
7449
git config --global user.email "$(git log -n 1 --pretty=format:%ae)"
7550
76-
- name: Get pnpm store path
77-
id: pnpm-store
78-
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
79-
80-
- name: Cache pnpm
81-
uses: actions/cache@v3
82-
with:
83-
path: ${{ steps.pnpm-store.outputs.PATH }}
84-
key:
85-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
86-
hashFiles('**/pnpm-lock.yaml') }}
87-
restore-keys: |
88-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
89-
90-
- name: Install Dependencies
91-
run: pnpm i
92-
9351
- name: Build Packages
9452
run: pnpm build # will also check types
9553

@@ -108,32 +66,11 @@ jobs:
10866
- name: Checkout Repository
10967
uses: actions/checkout@v3
11068

111-
- name: Install Node
112-
uses: actions/setup-node@v3
69+
- uses: the-guild-org/shared-config/setup@main
70+
name: Setup Env
11371
with:
114-
node-version: 18
115-
116-
- name: Install pnpm
117-
uses: pnpm/[email protected]
118-
with:
119-
version: 8
120-
121-
- name: Get pnpm store path
122-
id: pnpm-store
123-
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
124-
125-
- name: Cache pnpm
126-
uses: actions/cache@v3
127-
with:
128-
path: ${{ steps.pnpm-store.outputs.PATH }}
129-
key:
130-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
131-
hashFiles('**/pnpm-lock.yaml') }}
132-
restore-keys: |
133-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
134-
135-
- name: Install Dependencies
136-
run: pnpm i
72+
nodeVersion: 18
73+
packageManager: pnpm
13774

13875
- name: Build Packages
13976
run: pnpm build
@@ -153,32 +90,11 @@ jobs:
15390
- name: Checkout Repository
15491
uses: actions/checkout@v3
15592

156-
- name: Install Node
157-
uses: actions/setup-node@v3
158-
with:
159-
node-version: 16
160-
161-
- name: Install pnpm
162-
uses: pnpm/[email protected]
163-
with:
164-
version: 8
165-
166-
- name: Get pnpm store path
167-
id: pnpm-store
168-
run: echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
169-
170-
- name: Cache pnpm
171-
uses: actions/cache@v3
93+
- uses: the-guild-org/shared-config/setup@main
94+
name: Setup Env
17295
with:
173-
path: ${{ steps.pnpm-store.outputs.PATH }}
174-
key:
175-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-${{
176-
hashFiles('**/pnpm-lock.yaml') }}
177-
restore-keys: |
178-
${{ runner.os }}-pnpm-store-graphql-v${{ matrix.graphql-version }}-
179-
180-
- name: Install Dependencies
181-
run: pnpm i
96+
nodeVersion: 18
97+
packageManager: pnpm
18298

18399
- name: Build Packages
184100
run: pnpm build # will also check types

0 commit comments

Comments
 (0)