@@ -17,39 +17,42 @@ jobs:
17
17
- name : Checkout code
18
18
uses : actions/checkout@v4
19
19
20
- - name : Cache yarn.lock
20
+ - name : Install pnpm
21
+ run : npm install -g pnpm
22
+
23
+ - name : Set pnpm registry
24
+ run : pnpm config set registry https://registry.npmmirror.com/
25
+
26
+ - name : Cache pnpm-lock.yaml
21
27
uses : actions/cache@v4
22
28
with :
23
29
path : package-temp-dir
24
30
key : lock-${{ github.sha }}
25
31
26
- - name : Create yarn.lock
27
- run : yarn generate-lock-entry
28
-
29
32
- name : Hack for single file
30
33
run : |
31
34
if [ ! -d "package-temp-dir" ]; then
32
35
mkdir package-temp-dir
33
36
fi
34
- cp yarn. lock package-temp-dir
37
+ cp pnpm- lock.yaml package-temp-dir
35
38
- name : Cache node_modules
36
39
id : node_modules_cache_id
37
40
uses : actions/cache@v4
38
41
with :
39
42
path : node_modules
40
- key : node_modules-${{ hashFiles('**/package-temp-dir/yarn. lock') }}
43
+ key : node_modules-${{ hashFiles('**/package-temp-dir/pnpm- lock.yaml ') }}
41
44
42
45
- name : Install dependencies
43
46
if : steps.node_modules_cache_id.outputs.cache-hit != 'true'
44
- run : yarn
47
+ run : pnpm install
45
48
46
49
prettier :
47
50
needs : [setup]
48
51
runs-on : ubuntu-latest
49
52
steps :
50
53
- uses : actions/checkout@v2
51
54
52
- - name : Restore cache from yarn. lock
55
+ - name : Restore cache from pnpm- lock.yaml
53
56
uses : actions/cache@v4
54
57
with :
55
58
path : package-temp-dir
@@ -59,18 +62,18 @@ jobs:
59
62
uses : actions/cache@v4
60
63
with :
61
64
path : node_modules
62
- key : node_modules-${{ hashFiles('**/package-temp-dir/yarn. lock') }}
65
+ key : node_modules-${{ hashFiles('**/package-temp-dir/pnpm- lock.yaml ') }}
63
66
64
67
- name : Prettier check
65
- run : yarn prettier
68
+ run : pnpm prettier
66
69
67
70
eslint :
68
71
needs : [setup]
69
72
runs-on : ubuntu-latest
70
73
steps :
71
74
- uses : actions/checkout@v2
72
75
73
- - name : Restore cache from yarn. lock
76
+ - name : Restore cache from pnpm- lock.yaml
74
77
uses : actions/cache@v4
75
78
with :
76
79
path : package-temp-dir
@@ -80,18 +83,18 @@ jobs:
80
83
uses : actions/cache@v4
81
84
with :
82
85
path : node_modules
83
- key : node_modules-${{ hashFiles('**/package-temp-dir/yarn. lock') }}
86
+ key : node_modules-${{ hashFiles('**/package-temp-dir/pnpm- lock.yaml ') }}
84
87
85
88
- name : Eslint check
86
- run : yarn eslint
89
+ run : pnpm eslint
87
90
88
91
test :
89
92
needs : [setup]
90
93
runs-on : ubuntu-latest
91
94
steps :
92
95
- uses : actions/checkout@v2
93
96
94
- - name : Restore cache from yarn. lock
97
+ - name : Restore cache from pnpm- lock.yaml
95
98
uses : actions/cache@v4
96
99
with :
97
100
path : package-temp-dir
@@ -101,23 +104,23 @@ jobs:
101
104
uses : actions/cache@v4
102
105
with :
103
106
path : node_modules
104
- key : node_modules-${{ hashFiles('**/package-temp-dir/yarn. lock') }}
107
+ key : node_modules-${{ hashFiles('**/package-temp-dir/pnpm- lock.yaml ') }}
105
108
106
109
- name : Setup timezone
107
110
uses : zcong1993/setup-timezone@master
108
111
with :
109
112
timezone : Asia/Shanghai
110
113
111
114
- name : Unit Test
112
- run : yarn test
115
+ run : pnpm test
113
116
114
117
build :
115
118
runs-on : ubuntu-latest
116
119
needs : [setup, prettier, eslint, test]
117
120
steps :
118
121
- uses : actions/checkout@v2
119
122
120
- - name : Restore cache from yarn. lock
123
+ - name : Restore cache from pnpm- lock.yaml
121
124
uses : actions/cache@v4
122
125
with :
123
126
path : package-temp-dir
@@ -127,7 +130,7 @@ jobs:
127
130
uses : actions/cache@v4
128
131
with :
129
132
path : node_modules
130
- key : node_modules-${{ hashFiles('**/package-temp-dir/yarn. lock') }}
133
+ key : node_modules-${{ hashFiles('**/package-temp-dir/pnpm- lock.yaml ') }}
131
134
132
135
- name : Build test
133
- run : yarn build
136
+ run : pnpm build
0 commit comments