forked from NordicSemiconductor/pc-ble-driver-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-node.yml
57 lines (53 loc) · 1.9 KB
/
azure-node.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
parameters:
nodeVersion: ''
npmConfigRuntime: ''
npmConfigTarget: ''
npmConfigDistUrl: ''
VCPKG_ROOT: ''
steps:
- task: NodeTool@0
inputs:
versionSpec: '${{ parameters.nodeVersion }}'
condition: not(and(contains(variables['imageName'], 'win'), eq(variables['nodeArch'], '32')))
displayName: 'Install Node.js ${{ parameters.nodeVersion }}'
- bash: |
npm config set cmake_CMAKE_GENERATOR:INTERNAL="Visual Studio 15 2017 Win64"
condition: and(contains(variables['imageName'], 'win'), eq(variables['nodeArch'], '64'))
displayName: 'Setup Node.js on Windows 64-bit'
- bash: |
export PATH=$NVM_HOME:$PATH
nvm install ${{ parameters.nodeVersion }} $(nodeArch)
nvm use ${{ parameters.nodeVersion }} $(nodeArch)
ln -sf "$NVM_SYMLINK/node" "$NODE_SYMLINK/node"
npm config set cmake_CMAKE_GENERATOR:INTERNAL="Visual Studio 15 2017"
env: {
NVM_HOME: "/C/ProgramData/nvm",
NVM_SYMLINK: "/C/ProgramData/nvm/v$(parameters.nodeVersion)",
NODE_SYMLINK: "/C/Program Files/nodejs",
VCPKG_ROOT: "${{ parameters.VCPKG_ROOT }}",
}
condition: and(contains(variables['imageName'], 'win'), eq(variables['nodeArch'], '32'))
displayName: 'Setup Node.js on Windows 32-bit'
- bash: |
set -o errexit -o pipefail
echo "Using VCPKG_ROOT: $VCPKG_ROOT"
npm i
env: {
npm_config_runtime: '${{ parameters.npmConfigRuntime }}',
npm_config_target: '${{ parameters.npmConfigTarget }}',
VCPKG_ROOT: "${{ parameters.VCPKG_ROOT }}"
}
condition: not(contains(variables['imageName'], 'win'))
displayName: 'Build on Linux/macOS'
- script: |
npm i
env: {
npm_config_runtime: '${{ parameters.npmConfigRuntime }}',
npm_config_target: '${{ parameters.npmConfigTarget }}',
VCPKG_ROOT: "${{ parameters.VCPKG_ROOT }}",
}
condition: contains(variables['imageName'], 'win')
displayName: 'Build on Windows'
- script: |
npm test
displayName: 'Integration test'