2020-01-19 20:11:11 +00:00
|
|
|
|
# no PR triggers
|
|
|
|
|
pr: none
|
|
|
|
|
|
2019-03-28 14:16:01 +00:00
|
|
|
|
variables:
|
2019-11-26 21:12:10 +00:00
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2019-10-24 13:52:05 +00:00
|
|
|
|
ipfsVersion: '0.4.22'
|
|
|
|
|
node10: '^10.17.0'
|
2020-01-17 17:32:32 +00:00
|
|
|
|
node12: '^12.0.0'
|
|
|
|
|
node13: '^13.0.0'
|
2019-03-28 14:16:01 +00:00
|
|
|
|
pythonVersion: '2.7.x'
|
2019-10-24 13:52:05 +00:00
|
|
|
|
yarnVersion: '1.19.1'
|
2019-03-28 14:16:01 +00:00
|
|
|
|
|
2019-03-27 18:09:56 +00:00
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
Node 10 / Linux:
|
2019-03-28 14:16:01 +00:00
|
|
|
|
nodeVersion: $(node10)
|
2019-10-24 13:52:05 +00:00
|
|
|
|
imageName: 'ubuntu-18.04'
|
2019-03-28 14:16:01 +00:00
|
|
|
|
Node 10 / macOS:
|
|
|
|
|
nodeVersion: $(node10)
|
2019-10-24 13:52:05 +00:00
|
|
|
|
imageName: 'macos-10.14'
|
2019-03-28 14:16:01 +00:00
|
|
|
|
Node 10 / Windows:
|
|
|
|
|
nodeVersion: $(node10)
|
|
|
|
|
imageName: 'vs2017-win2016'
|
2020-01-17 17:32:32 +00:00
|
|
|
|
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'
|
2019-03-27 18:09:56 +00:00
|
|
|
|
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: $(imageName)
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- task: NodeTool@0
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: succeeded()
|
2019-03-28 14:16:01 +00:00
|
|
|
|
displayName: 'Install Node.js'
|
2019-03-27 18:09:56 +00:00
|
|
|
|
inputs:
|
|
|
|
|
versionSpec: $(nodeVersion)
|
|
|
|
|
|
2019-03-28 14:16:01 +00:00
|
|
|
|
- task: UsepythonVersion@0
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: succeeded()
|
2019-03-28 14:16:01 +00:00
|
|
|
|
displayName: 'Install Python'
|
|
|
|
|
inputs:
|
|
|
|
|
architecture: x64
|
|
|
|
|
versionSpec: $(pythonVersion)
|
2019-03-27 18:09:56 +00:00
|
|
|
|
|
2020-03-09 19:13:20 +00:00
|
|
|
|
- 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' )
|
|
|
|
|
|
2019-03-28 14:16:01 +00:00
|
|
|
|
- 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
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: succeeded()
|
2019-03-27 18:09:56 +00:00
|
|
|
|
displayName: 'Install IPFS'
|
2019-03-28 14:16:01 +00:00
|
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
|
export PATH="$(cd ../Downloads && pwd)/go-ipfs:${PATH}"
|
|
|
|
|
ipfs version
|
|
|
|
|
ipfs init
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: succeeded()
|
2019-03-28 14:16:01 +00:00
|
|
|
|
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
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: succeeded()
|
2019-03-28 14:16:01 +00:00
|
|
|
|
displayName: 'Install Yarn'
|
|
|
|
|
|
2019-11-26 21:12:10 +00:00
|
|
|
|
- task: Cache@2
|
|
|
|
|
inputs:
|
|
|
|
|
key: 'yarn | "$(Agent.OS)" | yarn.lock'
|
|
|
|
|
restoreKeys: |
|
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
|
yarn
|
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
|
displayName: 'Cache Yarn packages'
|
|
|
|
|
|
2019-03-28 14:16:01 +00:00
|
|
|
|
- bash: |
|
|
|
|
|
pushd "$PWD" &>/dev/null
|
|
|
|
|
cd ../Downloads
|
|
|
|
|
export PATH="${PWD}/go-ipfs:${PATH}"
|
2020-03-09 19:13:20 +00:00
|
|
|
|
export PATH="${PWD}:${PATH}"
|
2019-03-28 14:16:01 +00:00
|
|
|
|
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
|
2019-11-26 21:12:10 +00:00
|
|
|
|
yarn config set cache-folder "${YARN_CACHE_FOLDER}" &>/dev/null
|
2019-03-28 14:16:01 +00:00
|
|
|
|
popd &>/dev/null
|
|
|
|
|
npm run ci:full
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: and( succeeded(), ne( variables['Agent.OS'], 'Windows_NT' ) )
|
2019-03-28 14:16:01 +00:00
|
|
|
|
displayName: 'Test (*nix)'
|
|
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
|
pushd
|
|
|
|
|
cd ..\Downloads
|
|
|
|
|
$env:PATH="$($PWD.Path)\go-ipfs;$($env:PATH)"
|
2020-03-09 19:13:20 +00:00
|
|
|
|
$env:PATH="$($PWD.Path)\solidity-windows;$($env:PATH)"
|
2019-03-28 14:16:01 +00:00
|
|
|
|
$env:PATH="$($env:USERPROFILE)\.yarn\bin;$($env:USERPROFILE)\.config\yarn\global\node_modules\.bin;$($env:PATH)"
|
2019-11-26 21:12:10 +00:00
|
|
|
|
yarn config set cache-folder "$($YARN_CACHE_FOLDER)" | out-null
|
2019-03-28 14:16:01 +00:00
|
|
|
|
popd
|
|
|
|
|
npm run ci:full
|
2019-05-01 14:54:42 +00:00
|
|
|
|
condition: and( succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ) )
|
2019-03-28 14:16:01 +00:00
|
|
|
|
displayName: 'Test (Windows)'
|
2019-05-01 14:54:42 +00:00
|
|
|
|
|
|
|
|
|
- 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'
|