/
appveyor.yml
145 lines (121 loc) · 3.79 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
version: "{build}"
environment:
YARGS_MIN_NODE_VERSION: 10
TimeOutMins: 2
matrix:
- job_name: Build
appveyor_build_worker_image: Ubuntu
nodejs_version: 14
# # Ubuntu
- job_name: Ubuntu Node.js v.10
job_group: Tests
appveyor_build_worker_image: Ubuntu
job_depends_on: Build
nodejs_version: 10
- job_name: Ubuntu Node.js v.12
job_group: Tests
appveyor_build_worker_image: Ubuntu
job_depends_on: Build
nodejs_version: 12
- job_name: Ubuntu Node.js v.14
job_group: Tests
appveyor_build_worker_image: Ubuntu
job_depends_on: Build
nodejs_version: 14
- job_name: Ubuntu Node.js v.16
job_group: Tests
appveyor_build_worker_image: Ubuntu
job_depends_on: Build
nodejs_version: 16
# # MacOS
- job_name: macOS Node.js v.10
job_group: Tests
appveyor_build_worker_image: macos
job_depends_on: Build
nodejs_version: 10
- job_name: macOS Node.js v.12
job_group: Tests
appveyor_build_worker_image: macos
job_depends_on: Build
nodejs_version: 12
- job_name: macOS Node.js v.14
job_group: Tests
appveyor_build_worker_image: macos
job_depends_on: Build
nodejs_version: 14
- job_name: macOS Node.js v.16
job_group: Tests
appveyor_build_worker_image: macos
job_depends_on: Build
nodejs_version: 16
# # Windows
- job_name: Windows Node.js v.10
job_group: Tests
appveyor_build_worker_image: Visual Studio 2019
job_depends_on: Build
nodejs_version: 10
- job_name: Windows Node.js v.12
job_group: Tests
appveyor_build_worker_image: Visual Studio 2019
job_depends_on: Build
nodejs_version: 12
- job_name: Windows Node.js v.14
job_group: Tests
appveyor_build_worker_image: Visual Studio 2019
job_depends_on: Build
nodejs_version: 14
- job_name: Windows Node.js v.16
job_group: Tests
appveyor_build_worker_image: Visual Studio 2019
job_depends_on: Build
nodejs_version: 16
# matrix:
# allow_failures:
# - nodejs_version: 16
artifacts:
- path: tmp
name: package-tests
for:
-
matrix:
only:
- job_name: Build
build_script:
- sh: nvm install $nodejs_version
- sh: nvm use $nodejs_version
- sh: npm config get user-agent
- npm install
- ./lib/bin/npt.js pack -c .package-tester.json
-
matrix:
only:
- job_group: Tests
install:
- sh: nvm install $nodejs_version
- sh: nvm use $nodejs_version
- ps: if ($isWindows) { Install-Product node $env:nodejs_version $env:platform }
- npm config get user-agent
before_build:
- ps: |
$headers = @{
"Authorization" = "Bearer $ApiKey"
"Content-type" = "application/json"
}
[datetime]$stop = ([datetime]::Now).AddMinutes($env:TimeOutMins)
[bool]$success = $false
while(!$success -and ([datetime]::Now) -lt $stop) {
$project = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID" -Headers $headers -Method GET
$jobToWaitJson = $project.build.jobs | where {$_.name -eq "Build"}
$success = $jobToWaitJson.status -eq "success"
$jobToWaitId = $jobToWaitJson.jobId;
if (!$success) {Start-sleep 5}
}
if (!$success) {throw "Job `"Build`" was not finished in $env:TimeOutMins minutes"}
if (!$jobToWaitId) {throw "Unable t get JobId for the job `"Build`""}
Start-FileDownload https://ci.appveyor.com/api/buildjobs/$jobToWaitId/artifacts/package-tests.zip
build_script:
- 7z x package-tests.zip
- cd package-tests
- npm i --no-audit
test_script:
- npm run test