Skip to content

Commit dec99f5

Browse files
committed
ci: add cache to the ci
1 parent 3b96fbd commit dec99f5

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ on:
99
jobs:
1010
Build:
1111
if: "!contains(github.event.head_commit.message, '[skip ci]')"
12-
runs-on: ubuntu-latest
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
node:
19+
- 16
20+
pnpm:
21+
- 7
22+
1323
steps:
1424
- uses: actions/checkout@v3
1525
with:
@@ -21,14 +31,26 @@ jobs:
2131
- name: Checkout 🛎️
2232
uses: actions/checkout@v3
2333

34+
- name: Cache
35+
uses: actions/cache@v2
36+
with:
37+
path: |
38+
~/.pnpm-store
39+
D:\.pnpm-store
40+
~/.local/share/pnpm/store/
41+
~/AppData/Local/pnpm/store/
42+
key: "cache-OS:${{ matrix.os }}-Node:${{ matrix.node }}-${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-${{ hashFiles('./package.json') }}"
43+
restore-keys: |
44+
"cache-OS:${{ matrix.os }}-Node:${{ matrix.node }}-${{ matrix.pnpm }}"
45+
2446
- uses: actions/setup-node@v3
2547
with:
26-
node-version: 16
48+
node-version: ${{ matrix.node }}
2749

2850
- name: Setup PNPM
29-
uses: pnpm/action-setup@master
51+
uses: pnpm/action-setup@v2.2.2
3052
with:
31-
version: latest
53+
version: ${{ matrix.pnpm }}
3254

3355
- name: Install and Build 🔧
3456
run: |

0 commit comments

Comments
 (0)