10
10
- " *"
11
11
12
12
jobs :
13
- Test :
14
- name : ${{ matrix.os }}
13
+ Build :
14
+ runs-on : ubuntu-22.04
15
+ name : Build
15
16
if : ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
16
- runs-on : ${{ matrix.os }}
17
17
strategy :
18
18
fail-fast : false
19
19
matrix :
20
20
os :
21
- - windows-2022
22
- - windows-2019
23
21
- ubuntu-22.04
24
- - ubuntu-20.04
25
- - macos-12
26
- - macos-11
27
22
node :
28
23
- 20
29
24
pnpm :
30
25
- 8
31
26
steps :
32
27
- uses : actions/checkout@v3
33
- with :
34
- submodules : true
35
28
36
29
- name : Cache
37
30
uses : actions/cache@v3
40
33
~/.pnpm-store
41
34
D:\.pnpm-store
42
35
./node_modules
36
+ ./.parcel-cache
43
37
key : " setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
44
38
restore-keys : |
45
39
"setupcpp-cache-OS:${{ matrix.os }}-"
@@ -54,33 +48,152 @@ jobs:
54
48
with :
55
49
version : ${{ matrix.pnpm }}
56
50
57
- - name : Install and build
51
+ - name : Install
58
52
run : |
59
53
pnpm install
60
54
61
- # - name: Setup SSH debugging session
62
- # uses: mxschmitt/action-tmate@v3
55
+ - name : Build
56
+ run : |
57
+ pnpm build
58
+ pnpm build.docker_tests
63
59
64
- - name : Test
65
- if : " ${{ !contains(github.event.head_commit.message, '[skip test]') }}"
60
+ - name : Lint
66
61
run : |
67
- pnpm run test
62
+ pnpm run test.lint
63
+
64
+ - name : Upload Dist
65
+ uses : actions/upload-artifact@v3
66
+ with :
67
+ name : dist
68
+ path : |
69
+ ./dist
70
+ ./packages/*/dist
71
+ ./dev/docker/__tests__/
72
+ retention-days : 1
73
+
74
+ BuildExecutable :
75
+ name : Build-Executable-${{ matrix.os }}
76
+ needs : [Build]
77
+ if : ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
78
+ runs-on : ${{ matrix.os }}
79
+ strategy :
80
+ fail-fast : false
81
+ matrix :
82
+ os :
83
+ - windows-2022
84
+ - ubuntu-22.04
85
+ - macos-12
86
+ node :
87
+ - 20
88
+ pnpm :
89
+ - 8
90
+ steps :
91
+ - uses : actions/checkout@v3
92
+
93
+ - name : Download Artifacts
94
+ uses : actions/download-artifact@v3
95
+ with :
96
+ name : dist
97
+
98
+ - name : Setup Node
99
+ uses : actions/setup-node@v3
100
+ with :
101
+ node-version : ${{ matrix.node }}
102
+
103
+ - name : Setup Pnpm
104
+ uses : pnpm/action-setup@v2
105
+ with :
106
+ version : ${{ matrix.pnpm }}
107
+
108
+ - name : Cache node_modules
109
+ uses : actions/cache@v3
110
+ with :
111
+ path : |
112
+ ~/.pnpm-store
113
+ D:\.pnpm-store
114
+ ./node_modules
115
+ key : " setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
116
+ restore-keys : |
117
+ "setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
118
+
119
+ - name : Install
120
+ run : |
121
+ pnpm install
68
122
69
123
# Create self-contained executable that bundles Nodejs
70
124
- name : Create Executable
71
- if : " ${{ contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}"
72
125
run : |
73
126
pnpm run pack.exe
74
127
75
- - name : Upload Artifacts
76
- if : ${{ (startsWith(github.ref, 'refs/tags/')) && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}
128
+ - name : Upload Executables
77
129
uses : actions/upload-artifact@v3
78
130
with :
131
+ name : exe
79
132
path : |
80
133
./exe
81
- ./dist
82
134
retention-days : 1
83
135
136
+ Test :
137
+ name : Test-${{ matrix.os }}
138
+ if : ${{ !contains(github.event.head_commit.message, '[skip ci]') || !contains(github.event.head_commit.message, '[skip test]') }}
139
+ needs : [Build]
140
+ runs-on : ${{ matrix.os }}
141
+ strategy :
142
+ fail-fast : false
143
+ matrix :
144
+ os :
145
+ - windows-2022
146
+ - windows-2019
147
+ - ubuntu-22.04
148
+ - ubuntu-20.04
149
+ - macos-12
150
+ - macos-11
151
+ node :
152
+ - 20
153
+ pnpm :
154
+ - 8
155
+ steps :
156
+ - uses : actions/checkout@v3
157
+ with :
158
+ submodules : true
159
+
160
+ - name : Download Dist
161
+ uses : actions/download-artifact@v3
162
+ with :
163
+ name : dist
164
+
165
+ - name : Setup Node
166
+ uses : actions/setup-node@v3
167
+ with :
168
+ node-version : ${{ matrix.node }}
169
+
170
+ - name : Setup Pnpm
171
+ uses : pnpm/action-setup@v2
172
+ with :
173
+ version : ${{ matrix.pnpm }}
174
+
175
+ - name : Cache node_modules
176
+ uses : actions/cache@v3
177
+ with :
178
+ path : |
179
+ ~/.pnpm-store
180
+ D:\.pnpm-store
181
+ ./node_modules
182
+ key : " setupcpp-node_modules-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
183
+ restore-keys : |
184
+ "setupcpp-node_modules-cache-OS:${{ matrix.os }}-"
185
+
186
+ - name : Install
187
+ run : |
188
+ pnpm install
189
+
190
+ # - name: Setup SSH debugging session
191
+ # uses: mxschmitt/action-tmate@v3
192
+
193
+ - name : Tests
194
+ run : |
195
+ pnpm run test
196
+
84
197
- name : Setup Node 12
85
198
uses : actions/setup-node@v3
86
199
with :
@@ -97,38 +210,10 @@ jobs:
97
210
run : |
98
211
node ./dist/actions/setup-cpp.js --help
99
212
100
- Release :
101
- needs : Test
102
- if : startsWith(github.ref, 'refs/tags/')
103
- runs-on : ubuntu-22.04
104
- steps :
105
- - name : Download Artifacts
106
- uses : actions/download-artifact@v3
107
-
108
- - name : Place Artifacts
109
- run : |
110
- mv -v artifact/* ./
111
- chmod +x -R ./exe/
112
-
113
- - name : Draft the release
114
- uses : meeDamian/github-release@2.0
115
- with :
116
- token : ${{ secrets.GITHUB_TOKEN }}
117
- gzip : folders
118
- draft : true
119
- files : >
120
- ./exe/setup-cpp-x64-windows.exe
121
- ./exe/setup-cpp-x64-linux
122
- ./exe/setup-cpp-x64-macos
123
- ./dist/legacy/setup-cpp.js
124
- ./dist/legacy/setup-cpp.js.map
125
- ./dist/legacy/
126
- ./dist/actions/
127
- ./dist/modern/
128
-
129
213
Docker :
130
- name : ${{ matrix.container }}
214
+ name : Test- ${{ matrix.container }}
131
215
if : ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip test]') }}
216
+ needs : [Build]
132
217
runs-on : ${{ matrix.os }}
133
218
strategy :
134
219
fail-fast : false
@@ -151,33 +236,43 @@ jobs:
151
236
with :
152
237
submodules : true
153
238
154
- - name : Cache
155
- uses : actions/cache@v3
156
- with :
157
- path : |
158
- ~/.pnpm-store
159
- D:\.pnpm-store
160
- ./node_modules
161
- key : " setupcpp-docker-cache-OS:${{ matrix.os }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
162
- restore-keys : |
163
- "setupcpp-docker-cache-OS:${{ matrix.os }}"
164
-
165
- - name : Setup Node
166
- uses : actions/setup-node@v3
167
- with :
168
- node-version : ${{ matrix.node }}
169
-
170
- - name : Setup Pnpm
171
- uses : pnpm/action-setup@v2
239
+ - name : Download Dist
240
+ uses : actions/download-artifact@v3
172
241
with :
173
- version : ${{ matrix.pnpm }}
174
-
175
- - name : Install and build
176
- run : |
177
- pnpm install
178
- pnpm build.docker_tests
242
+ name : dist
179
243
180
244
- name : Build
181
245
id : docker_build
182
246
run : |
183
247
docker build -f ./dev/docker/__tests__/${{ matrix.container }} -t setup-cpp .
248
+
249
+ Release :
250
+ if : startsWith(github.ref, 'refs/tags/')
251
+ needs : [Build, BuildExecutable, Test, Docker]
252
+ runs-on : ubuntu-22.04
253
+ steps :
254
+ - name : Download All Artifacts
255
+ uses : actions/download-artifact@v3
256
+
257
+ - name : Place Artifacts
258
+ shell : bash
259
+ run : |
260
+ mv -v ./dist/* ./
261
+ mv -v ./exe/* ./
262
+ chmod +x -R ./exe/
263
+
264
+ - name : Draft the release
265
+ uses : meeDamian/github-release@2.0
266
+ with :
267
+ token : ${{ secrets.GITHUB_TOKEN }}
268
+ gzip : folders
269
+ draft : true
270
+ files : >
271
+ ./exe/setup-cpp-x64-windows.exe
272
+ ./exe/setup-cpp-x64-linux
273
+ ./exe/setup-cpp-x64-macos
274
+ ./dist/legacy/setup-cpp.js
275
+ ./dist/legacy/setup-cpp.js.map
276
+ ./dist/legacy/
277
+ ./dist/actions/
278
+ ./dist/modern/
0 commit comments