@@ -14,105 +14,25 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- setup :
17+ build-and-test :
1818 runs-on : ubuntu-latest
1919 steps :
20- - name : Checkout code
21- uses : actions/checkout@v3
22- with :
23- fetch-depth : 0
24-
25- - name : Setup Node.js
26- uses : actions/setup-node@v3
27- with :
28- node-version : 18
29- cache : ' pnpm'
20+ - uses : actions/checkout@v3
3021
31- - name : Install pnpm
32- uses : pnpm/action-setup@v2
22+ - uses : pnpm/action-setup@v2
3323 with :
3424 version : 8.9.0
35- run_install : false
3625
37- - name : Get pnpm store directory
38- shell : bash
39- run : |
40- echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
41-
42- - name : Setup pnpm cache
43- uses : actions/cache@v3
44- with :
45- path : ${{ env.STORE_PATH }}
46- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47- restore-keys : |
48- ${{ runner.os }}-pnpm-store-
49-
50- - name : Install dependencies
51- run : pnpm install --frozen-lockfile
52-
53- - name : Cache node_modules
54- uses : actions/cache@v3
55- with :
56- path : node_modules
57- key : ${{ runner.os }}-modules-${{ hashFiles('pnpm-lock.yaml') }}
58-
59- build :
60- needs : setup
61- runs-on : ubuntu-latest
62- steps :
63- - name : Checkout code
64- uses : actions/checkout@v3
65-
66- - name : Setup Node.js
67- uses : actions/setup-node@v3
26+ - uses : actions/setup-node@v3
6827 with :
6928 node-version : 18
29+ cache : ' pnpm'
7030
71- - name : Install pnpm
72- uses : pnpm/action-setup@v2
73- with :
74- version : 8.9.0
75- run_install : false
76-
77- - name : Restore node_modules
78- uses : actions/cache@v3
79- with :
80- path : node_modules
81- key : ${{ runner.os }}-modules-${{ hashFiles('pnpm-lock.yaml') }}
31+ - name : Install dependencies
32+ run : pnpm install
8233
8334 - name : Build
8435 run : pnpm build
8536
86- - name : Upload build artifacts
87- uses : actions/upload-artifact@v3
88- with :
89- name : build-output
90- path : dist/
91- retention-days : 1
92-
93- test :
94- needs : setup
95- runs-on : ubuntu-latest
96- steps :
97- - name : Checkout code
98- uses : actions/checkout@v3
99-
100- - name : Setup Node.js
101- uses : actions/setup-node@v3
102- with :
103- node-version : 18
104-
105- - name : Install pnpm
106- uses : pnpm/action-setup@v2
107- with :
108- version : 8.9.0
109- run_install : false
110-
111- - name : Restore node_modules
112- uses : actions/cache@v3
113- with :
114- path : node_modules
115- key : ${{ runner.os }}-modules-${{ hashFiles('pnpm-lock.yaml') }}
116-
11737 - name : Test
11838 run : pnpm test
0 commit comments