@@ -14,105 +14,25 @@ concurrency:
14
14
cancel-in-progress : true
15
15
16
16
jobs :
17
- setup :
17
+ build-and-test :
18
18
runs-on : ubuntu-latest
19
19
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
30
21
31
- - name : Install pnpm
32
- uses : pnpm/action-setup@v2
22
+ - uses : pnpm/action-setup@v2
33
23
with :
34
24
version : 8.9.0
35
- run_install : false
36
25
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
68
27
with :
69
28
node-version : 18
29
+ cache : ' pnpm'
70
30
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
82
33
83
34
- name : Build
84
35
run : pnpm build
85
36
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
-
117
37
- name : Test
118
38
run : pnpm test
0 commit comments