-
Notifications
You must be signed in to change notification settings - Fork 493
/
azure-pipelines.yml
178 lines (163 loc) · 4.98 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# no PR triggers
pr: none
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
ipfsVersion: '0.4.22'
node10: '^10.17.0'
node12: '^12.0.0'
node13: '^13.0.0'
pythonVersion: '2.7.x'
yarnVersion: '1.19.1'
strategy:
matrix:
Node 10 / Linux:
nodeVersion: $(node10)
imageName: 'ubuntu-18.04'
Node 10 / macOS:
nodeVersion: $(node10)
imageName: 'macos-10.14'
Node 10 / Windows:
nodeVersion: $(node10)
imageName: 'vs2017-win2016'
Node 12 / Linux:
nodeVersion: $(node12)
imageName: 'ubuntu-18.04'
Node 12 / macOS:
nodeVersion: $(node12)
imageName: 'macos-10.14'
Node 12 / Windows:
nodeVersion: $(node12)
imageName: 'vs2017-win2016'
Node 13 / Linux:
nodeVersion: $(node13)
imageName: 'ubuntu-18.04'
Node 13 / macOS:
nodeVersion: $(node13)
imageName: 'macos-10.14'
Node 13 / Windows:
nodeVersion: $(node13)
imageName: 'vs2017-win2016'
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
condition: succeeded()
displayName: 'Install Node.js'
inputs:
versionSpec: $(nodeVersion)
- task: UsepythonVersion@0
condition: succeeded()
displayName: 'Install Python'
inputs:
architecture: x64
versionSpec: $(pythonVersion)
- script: |
mkdir -p ../Downloads
cd ../Downloads
curl -L -o "solc" "https://github.com/ethereum/solidity/releases/download/v0.6.4/solc-static-linux"
chmod +x solc
displayName: Linux install Solc
condition: eq( variables['Agent.OS'], 'Linux' )
# NOTICE:
# Solc installation disabled for now until solc provides binaries for download.
# Installation on Mac via brew takes too long.
#
#- script: |
# brew update
# brew upgrade
# brew tap ethereum/ethereum
# brew install solidity
# displayName: Mac install Solc
# condition: eq( variables['Agent.OS'], 'Darwin' )
- powershell: |
mkdir -p ../Downloads
$client = new-object System.Net.WebClient
$client.DownloadFile("https://github.com/ethereum/solidity/releases/download/v0.6.4/solidity-windows.zip", "..\Downloads\solidity-windows.zip")
Expand-Archive –Path “..\Downloads\solidity-windows.zip” –Destination “..\Downloads\solidity-windows”
displayName: Windows install Solc
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
mkdir -p ../Downloads
cd ../Downloads
ARCHIVE_EXT="tar.gz"
if [[ "$AGENT_OS" = "Linux" ]]; then
OS="linux"
fi
if [[ "$AGENT_OS" = "Darwin" ]]; then
OS="darwin"
fi
if [[ "$AGENT_OS" = "Windows_NT" ]]; then
OS="windows"
ARCHIVE_EXT="zip"
fi
URL="https://dist.ipfs.io/go-ipfs/v${IPFSVERSION}/go-ipfs_v${IPFSVERSION}_${OS}-amd64.${ARCHIVE_EXT}"
curl -L -o "go-ipfs.${ARCHIVE_EXT}" "$URL"
if [[ "$AGENT_OS" = "Windows_NT" ]]; then
unzip go-ipfs.zip
else
tar xzvf go-ipfs.tar.gz
fi
condition: succeeded()
displayName: 'Install IPFS'
- bash: |
export PATH="$(cd ../Downloads && pwd)/go-ipfs:${PATH}"
ipfs version
ipfs init
condition: succeeded()
displayName: 'Initialize IPFS'
- bash: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "$YARNVERSION"
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
yarn --version
mkdir -p ../Downloads/Yarn
condition: succeeded()
displayName: 'Install Yarn'
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: 'Cache Yarn packages'
- bash: |
pushd "$PWD" &>/dev/null
cd ../Downloads
export PATH="${PWD}/go-ipfs:${PATH}"
export PATH="${PWD}:${PATH}"
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
yarn config set cache-folder "${YARN_CACHE_FOLDER}" &>/dev/null
popd &>/dev/null
npm run ci:full
condition: and( succeeded(), ne( variables['Agent.OS'], 'Windows_NT' ) )
displayName: 'Test (*nix)'
- powershell: |
pushd
cd ..\Downloads
$env:PATH="$($PWD.Path)\go-ipfs;$($env:PATH)"
$env:PATH="$($PWD.Path)\solidity-windows;$($env:PATH)"
$env:PATH="$($env:USERPROFILE)\.yarn\bin;$($env:USERPROFILE)\.config\yarn\global\node_modules\.bin;$($env:PATH)"
yarn config set cache-folder "$($YARN_CACHE_FOLDER)" | out-null
popd
npm run ci:full
condition: and( succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ) )
displayName: 'Test (Windows)'
- bash: |
if [[ "$AGENT_OS" = "Linux" ]]; then
OS="Linux"
fi
if [[ "$AGENT_OS" = "Darwin" ]]; then
OS="macOS"
fi
if [[ "$AGENT_OS" = "Windows_NT" ]]; then
OS="Windows"
fi
export CI_PULL_REQUEST=$(node scripts/coveralls-pr-id)
if [[ -z "$CI_PULL_REQUEST" ]]; then
unset CI_PULL_REQUEST
fi
export COVERALLS_GIT_BRANCH=$(node scripts/coveralls-branch-name)
export COVERALLS_SERVICE_NAME="Azure Pipelines (${OS})"
npm run coveralls
condition: succeeded()
displayName: 'Coveralls'