@@ -36,6 +36,40 @@ executors:
3636# # COMMANDS ##
3737
3838commands :
39+ npm_install :
40+ parameters :
41+ << : *common_parameters
42+ steps :
43+ - when :
44+ condition :
45+ equal : [ alpine, << parameters.os >> ]
46+ steps :
47+ - run : apk update
48+ - run : apk add --no-cache nodejs npm
49+
50+ - when :
51+ condition :
52+ equal : [ debian, << parameters.os >> ]
53+ steps :
54+ - run : apt-get update
55+ - run : apt-get install --no-install-recommends -y ca-certificates nodejs npm
56+
57+ - when :
58+ condition :
59+ equal : [ linux, << parameters.os >> ]
60+ steps :
61+ - run : sudo apt-get update
62+ - run : sudo apt-get install --no-install-recommends -y ca-certificates nodejs npm
63+
64+ - when :
65+ condition :
66+ equal : [ "win/default", << parameters.os >> ]
67+ steps :
68+ - run : git config --global core.autocrlf false
69+ - run : git config --global core.eol lf
70+
71+ - run : npm install
72+
3973 prepare :
4074 parameters :
4175 << : *common_parameters
@@ -74,8 +108,6 @@ commands:
74108 steps :
75109 - run : choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'
76110 - run : choco install ninja
77- - run : git config --global core.autocrlf false
78- - run : git config --global core.eol lf
79111
80112 - run : git clone https://github.com/emscripten-core/emsdk.git
81113
@@ -95,11 +127,7 @@ commands:
95127 - run : cd emsdk && ./emsdk install latest
96128 - run : cd emsdk && ./emsdk activate latest
97129
98- - run : npm install
99-
100130 lint :
101- parameters :
102- << : *common_parameters
103131 steps :
104132 - run : npm run lint
105133
@@ -160,17 +188,20 @@ jobs:
160188 executor : { name: << parameters.os >> }
161189 steps :
162190 - checkout
163- - prepare :
191+ - npm_install :
164192 os : << parameters.os >>
165- - lint :
193+ - prepare :
166194 os : << parameters.os >>
195+ - lint
167196
168197 build :
169198 parameters :
170199 << : *common_parameters
171200 executor : { name: << parameters.os >> }
172201 steps :
173202 - checkout
203+ - npm_install :
204+ os : << parameters.os >>
174205 - prepare :
175206 os : << parameters.os >>
176207 - build :
@@ -184,26 +215,27 @@ jobs:
184215 executor : { name: << parameters.os >> }
185216 steps :
186217 - checkout
187- - prepare :
218+ - npm_install :
188219 os : << parameters.os >>
189220 - test
190221
191222# # WORKFLOWS ##
192223
224+ matrix : &matrix
225+ matrix :
226+ parameters :
227+ os : [ debian, linux, macos, "win/default" ]
228+
193229workflows :
194230 postject :
195231 jobs :
196232 - lint :
197233 matrix :
198234 parameters :
199- os : [ linux, macos, "win/default" ]
235+ os : [ linux, macos ]
200236 - build :
201- matrix :
202- parameters :
203- os : [ debian, linux, macos, "win/default" ]
237+ << : *matrix
204238 - test :
205- matrix :
206- parameters :
207- os : [ alpine, debian, linux, macos, "win/default" ]
208- requires : [ build-linux ]
239+ << : *matrix
240+ requires : [ build-<< matrix.os >> ]
209241
0 commit comments