forked from serialport/node-serialport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
119 lines (98 loc) · 3.39 KB
/
appveyor.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
os: unstable
environment:
NODE_PRE_GYP_GITHUB_TOKEN:
secure: VM4yc2j2L3KS5qWLZLY7WUAXoqdB9YkodmXlHC2I+LSF0Y8a2cZ70M0+2+Fd5GkQ
COVERALLS_REPO_TOKEN:
secure: iDcAJCYgJK4tffyzEHbMVR8DatJcIN8eY0h29p9JQkl43TcEcm6Z6JLOBpGDk1MJ
matrix:
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "7"
- electron_version: "1.4.12"
nodejs_version: "6"
platform:
- x86
- x64
install:
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform;
- ps: $env:Path += ";$(pwd)\node_modules\.bin";
- ps: >
@{
"nodejs_version" = $env:nodejs_version
"platform" = $env:platform
"node binary version" = $(node -v)
"node platform@arch" = $(node -p 'process.platform + process.arch')
"npm version" = $(npm -v)
"APPVEYOR_REPO_COMMIT_MESSAGE" = $env:APPVEYOR_REPO_COMMIT_MESSAGE
"git latest tag" = "$(git describe --tags --always HEAD)"
"appveyor_repo_tag" = $env:appveyor_repo_tag
"electron_version" = $env:electron_version
} | Out-String | Write-Host;
# work around bug in npm 2.15.1 where checksums were coming back bad (node 0.12)
- ps: >
if ($(npm -v) -eq "2.15.1") {
npm install -g npm@3 | Write-Host;
}
npm -v | Write-Host;
# work around an issue with node-gyp v3.3.1 and node 4x
# package.json has no certificates in it so we're cool
# https://github.com/nodejs/node-gyp/issues/921
- ps: npm config set -g cafile=package.json | Write-Host;
- ps: npm config set -g strict-ssl=false | Write-Host;
# Check if we're building the latest tag, if so
# then we publish the binaries if tests pass.
- ps: >
if ($env:appveyor_repo_tag -match "true" -and ("$(git describe --tags --always HEAD)" -eq $env:appveyor_repo_tag_name)) {
$env:publish_binary = 1;
} else {
$env:publish_binary = 0;
}
true;
- ps: >
if ($env:publish_binary -eq 1) {
"We're publishing a binary!" | Write-Host
} else {
"We're not publishing a binary" | Write-Host
}
true;
# Cleanup the output of npm
- ps: >
npm config set progress false
npm config set spin false
# We don't currently have a port to test on windows
# - ps: $env:TEST_PORT = "COM1";
# Setup Electron variables
- ps: >
if ($env:electron_version) {
"We're an electron build, setup variables" | Write-Host
$env:npm_config_target = $env:electron_version
$env:npm_config_disturl = "https://atom.io/download/atom-shell"
$env:npm_config_runtime = "electron"
if ($env:plaftorm -eq "x86") {
$env:npm_config_arch = "ia32"
} else {
$env:npm_config_arch = "x64"
}
"Install electron and electron-mocha" | Write-Host
npm install -g electron@$env:electron_version
npm install electron-mocha
}
true;
build_script:
- npm install --build-from-source --msvs_version=2013
test_script:
- ps: npm run lint
# If we run npm test in powershell it'll have the wrong encoding
# so we have to do it like this
- IF DEFINED electron_version (electron test/electron)
- IF NOT DEFINED electron_version (node ./)
- IF NOT DEFINED electron_version (npm test)
- IF %PUBLISH_BINARY% == 1 (node-pre-gyp package 2>&1)
- IF %PUBLISH_BINARY% == 1 (node-pre-gyp-github publish --release 2>&1)
- IF %PUBLISH_BINARY% == 1 (node-pre-gyp clean)
- IF %PUBLISH_BINARY% == 1 (npm install --fallback-to-build=false)
after_test:
- pip install codecov && codecov
deploy: OFF
matrix:
fast_finish: true