This repository has been archived by the owner on May 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
100 lines (85 loc) · 3.32 KB
/
azure-pipelines.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
trigger:
- master
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python27-x64:
python.arch: 'x64'
python.version: '2.7'
Python35-x64:
python.arch: 'x64'
python.version: '3.5'
Python36-x64:
python.arch: 'x64'
python.version: '3.6'
Python37-x64:
python.arch: 'x64'
python.version: '3.7'
maxParallel: 4
steps:
- powershell: |
$environmentVars = get-childitem -path env:*
foreach($var in $environmentVars)
{
$keyname = $var.Key
$keyvalue = $var.Value
Write-Output "${keyname}: $keyvalue"
}
displayName: Display env. variables
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
addToPath: true
architecture: '$(python.arch)'
- script: |
python.exe -m pip install -U scikit-ci-addons
python.exe -m ci_addons --install ../addons
displayName: Install scikit-ci-addons
- powershell: |
$BOOTSTRAP_REPO_SLUG = $env:BUILD_REPOSITORY_NAME
$BOOTSTRAP_BRANCH = $env:BUILD_SOURCEBRANCHNAME
if($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -ne $null) {
#
# Since Azure hides the value of "System.PullRequest.SourceRepositoryURI"
# for Pull request from fork, retrieve PR repo and branch name directly
# from GitHub
#
# See also https://developer.github.com/v3/pulls/#get-a-single-pull-request
#
$GitHubUri="https://api.github.com/repos/scikit-build/scikit-ci/pulls/$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
$BOOTSTRAP_BRANCH=(Invoke-WebRequest `
-Uri $GitHubUri `
-Headers @{ `
"Accept"= "application/vnd.github.v3.raw" `
} | ConvertFrom-Json).head.ref
$BOOTSTRAP_REPO_SLUG=(Invoke-WebRequest `
-Uri $GitHubUri `
-Headers @{ `
"Accept"= "application/vnd.github.v3.raw" `
} | ConvertFrom-Json).head.repo.full_name
Write-Output "System.PullRequest.SourceRepositoryURI: $(System.PullRequest.SourceRepositoryURI)"
}
Write-Output "BUILD_REASON: $env:BUILD_REASON"
Write-Output "BOOTSTRAP_REPO_SLUG: $BOOTSTRAP_REPO_SLUG"
Write-Output "BOOTSTRAP_BRANCH: $BOOTSTRAP_BRANCH"
git clone git://github.com/$BOOTSTRAP_REPO_SLUG -b $BOOTSTRAP_BRANCH ../bootstrap-scikit-ci
python.exe -m pip install -U ../bootstrap-scikit-ci/
displayName: Bootstrap
# scikit-ci-yml.rst: start
- script: python -m ci install
displayName: Install
- script: python -m ci build
displayName: Build
- script: python -m ci test
displayName: Test
- powershell: |
if ($env:CODECOV_TOKEN -ne $null -And $env:BUILD_REASON -ne "PullRequest") {
python -m ci after_test
}
displayName: After Test
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
# scikit-ci-yml.rst: end