@@ -9,6 +9,7 @@ workflows:
9
9
- build_for_windows :
10
10
context : scratch-desktop-and-link
11
11
orbs :
12
+
12
13
windows :
circleci/[email protected]
13
14
aliases :
14
15
# condition to indicate whether or not we should sign this build
34
35
xcode : 11.7.0
35
36
resource_class : macos.x86.medium.gen2 # "medium" has been deprecated
36
37
steps :
38
+ - node/install :
39
+ node-version : " 16.*"
40
+ - run : node --version && npm --version
37
41
- checkout
38
- - npm_install :
39
- npmCacheDir : ~/.npm
42
+ - node/install-packages
40
43
- run :
41
44
name : Test
42
45
command : npm run test
@@ -101,7 +104,9 @@ jobs:
101
104
- store_artifacts :
102
105
path : Artifacts/
103
106
build_for_windows :
104
- executor : windows/default
107
+ executor :
108
+ name : windows/default
109
+ shell : bash.exe # defaulting to bash at the executor level makes the Node orb kinda work
105
110
steps :
106
111
- run :
107
112
# work around https://github.com/appveyor/ci/issues/2420 which seems to affect CircleCI too
@@ -112,15 +117,26 @@ jobs:
112
117
echo 'Adding libexec/git-core to PATH...'
113
118
echo 'For more details see https://github.com/appveyor/ci/issues/2420'
114
119
echo 'export PATH="$PATH:/c/Program Files/Git/mingw64/libexec/git-core"' >> $BASH_ENV
115
- - run :
116
- # nvm for Windows doesn't accept partial version numbers, so specify exact :(
117
- name : Upgrade to Node 14.17.0
120
+ - run : # node/install doesn't work right on Windows
121
+ name : Install Node
122
+ # as of today, the Windows image comes with nvm 1.1.7
123
+ # nvm version 1.1.9 fixes an issue leading to "npm ERR! Unexpected token '.'"
124
+ # nvm version 1.1.10 will support "nvm install 16"
125
+ # but for now it needs the exact version
118
126
command : |
119
- nvm install 14.17.0
120
- nvm use 14.17.0
127
+ choco upgrade --yes nvm.portable
128
+ nvm --version
129
+ nvm install 16.20.0
130
+ nvm use 16.20.0
131
+ - run :
132
+ name : Increase NPM log level to avoid timeouts while installing packages
133
+ command : npm config set loglevel http
134
+ - run : node --version && npm --version
121
135
- checkout
122
- - npm_install :
123
- npmCacheDir : " C:/Users/circleci/AppData/Roaming/npm-cache"
136
+ - node/install-packages :
137
+ # the Node orb doesn't understand the default cache path on Windows
138
+ # make sure to use a path that works with Windows Node.js AND MSYS/MinGW bash
139
+ cache-path : " C:/tmp/npm-cache"
124
140
- run :
125
141
name : Test
126
142
command : npm run test
@@ -170,27 +186,6 @@ jobs:
170
186
- store_artifacts :
171
187
path : Artifacts/
172
188
commands :
173
- npm_install :
174
- description : Run 'npm install' with caching
175
- parameters :
176
- npmCacheDir :
177
- type : string
178
- description : NPM cache directory (`npm config cache get`) - usually either ~/.npm or %AppData%/npm-cache
179
- steps :
180
- - restore_cache :
181
- keys :
182
- - npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
183
- - run :
184
- name : Install node_modules
185
- shell : bash # harmless on macOS, required on Windows to work around git-sh-setup issue
186
- # --prefer-offline "will make npm skip any conditional requests (304 checks) for stale cache data, and only
187
- # hit the network if something is missing from the cache"
188
- command : npm ci --prefer-offline
189
- environment : *clear_context
190
- - save_cache :
191
- paths :
192
- - << parameters.npmCacheDir >>
193
- key : npm-cache-{{ arch }}-{{ checksum "package-lock.json" }}
194
189
build :
195
190
steps :
196
191
- when :
0 commit comments