embark/azure-pipelines.yml

113 lines
3.0 KiB
YAML
Raw Normal View History

2019-03-28 14:16:01 +00:00
variables:
ipfsVersion: '0.4.19'
node8: '^8.12.0'
node10: '^10.0.0'
pythonVersion: '2.7.x'
yarnVersion: '1.12.3'
2019-03-27 18:09:56 +00:00
strategy:
matrix:
Node 8 / Linux:
2019-03-28 14:16:01 +00:00
nodeVersion: $(node8)
2019-03-27 18:09:56 +00:00
imageName: 'ubuntu-16.04'
2019-03-28 14:16:01 +00:00
Node 8 / macOS:
nodeVersion: $(node8)
2019-03-27 18:09:56 +00:00
imageName: 'macos-10.13'
2019-03-28 14:16:01 +00:00
Node 8 / Windows:
nodeVersion: $(node8)
imageName: 'vs2017-win2016'
2019-03-27 18:09:56 +00:00
Node 10 / Linux:
2019-03-28 14:16:01 +00:00
nodeVersion: $(node10)
2019-03-27 18:09:56 +00:00
imageName: 'ubuntu-16.04'
2019-03-28 14:16:01 +00:00
Node 10 / macOS:
nodeVersion: $(node10)
imageName: 'macos-10.13'
Node 10 / Windows:
nodeVersion: $(node10)
imageName: 'vs2017-win2016'
2019-03-27 18:09:56 +00:00
pool:
vmImage: $(imageName)
steps:
- task: NodeTool@0
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
displayName: 'Install Python'
inputs:
architecture: x64
versionSpec: $(pythonVersion)
2019-03-27 18:09:56 +00:00
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-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
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
displayName: 'Install Yarn'
- bash: |
pushd "$PWD" &>/dev/null
cd ../Downloads
export PATH="${PWD}/go-ipfs:${PATH}"
export PATH="${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin:${PATH}"
yarn config set cache-folder "${PWD}/Yarn" &>/dev/null
popd &>/dev/null
npm run ci:full
if [[ "$AGENT_OS" = "Linux" ]]; then
OS="Linux"
fi
if [[ "$AGENT_OS" = "Darwin" ]]; then
OS="macOS"
fi
export COVERALLS_GIT_BRANCH=$(node scripts/coveralls-branch-name)
export COVERALLS_SERVICE_NAME="Azure Pipelines (${OS})"
npm run coveralls
2019-03-28 14:16:01 +00:00
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Test (*nix)'
- powershell: |
pushd
cd ..\Downloads
$env:PATH="$($PWD.Path)\go-ipfs;$($env:PATH)"
$env:PATH="$($env:USERPROFILE)\.yarn\bin;$($env:USERPROFILE)\.config\yarn\global\node_modules\.bin;$($env:PATH)"
yarn config set cache-folder "$($PWD.Path)\Yarn" | out-null
popd
npm run ci:full
$env:COVERALLS_GIT_BRANCH=node scripts/coveralls-branch-name
$env:COVERALLS_SERVICE_NAME="Azure Pipelines (Windows)"
npm run coveralls
2019-03-28 14:16:01 +00:00
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Test (Windows)'