@@ -13,9 +13,9 @@ variables:
13
13
GH_PROJECT_URL : " https://${GITHUB_TOKEN}@github.com/${GH_PROJECT_PATH}.git"
14
14
GIT_SUBMODULE_STRATEGY : recursive
15
15
# Cache .npm
16
- NPM_CONFIG_CACHE : " ${CI_PROJECT_DIR}/tmp/npm"
16
+ npm_config_cache : " ${CI_PROJECT_DIR}/tmp/npm"
17
17
# Prefer offline node module installation
18
- NPM_CONFIG_PREFER_OFFLINE : " true"
18
+ npm_config_prefer_offline : " true"
19
19
# `ts-node` has its own cache
20
20
TS_CACHED_TRANSPILE_CACHE : " ${CI_PROJECT_DIR}/tmp/ts-node-cache"
21
21
TS_CACHED_TRANSPILE_PORTABLE : " true"
32
32
- ./tmp/Homebrew
33
33
# `jest` cache is configured in jest.config.js
34
34
- ./tmp/jest/
35
+ # `node-gyp` cache used by windows and macos
36
+ - ./tmp/node-gyp
35
37
36
38
stages :
37
39
- check # Linting, unit tests
@@ -144,14 +146,21 @@ build:windows:
144
146
needs : []
145
147
tags :
146
148
- windows
149
+ variables :
150
+ # Target node version must match nixpkgs `pkgs.nodejs.version`
151
+ npm_config_target : ' 16.14.2'
152
+ # Location node-gyp installed headers and static libraries
153
+ npm_config_devdir : " ${CI_PROJECT_DIR}/tmp/node-gyp"
154
+ npm_config_nodedir : " ${CI_PROJECT_DIR}/tmp/node-gyp/$npm_config_target"
147
155
before_script :
148
- - choco install nodejs --version=16.14.2 -y
156
+ - choco install nodejs --version="$npm_config_target" -y
149
157
- choco install python --version=3.9.12 -y
150
158
- refreshenv
151
159
script :
152
160
- npm config set msvs_version 2019 --location project
153
161
- npm install --ignore-scripts
154
162
- $env:Path = "$(npm bin);" + $env:Path
163
+ - node-gyp install --ensure
155
164
- npm run build --verbose
156
165
- npm test -- --ci
157
166
artifacts :
0 commit comments