tridactyl/.appveyor.yml

135 lines
4.1 KiB
YAML
Raw Permalink Normal View History

# Build worker image (VM template)
image: Visual Studio 2017
# Build platform, i.e. x86, x64, Any CPU.
platform:
- Any CPU
# Set `git clone` directory
clone_folder: 'C:\Tridactyl'
init:
# Verify %PATH%
- ps: Write-Host "[+] Current PATH contains ..."
- ps: Write-Host $env:PATH.Replace(";", "`r`n")
# Verify Bash
- ps: Write-Host "[+] Location of Bash ..."
- ps: Get-Command -Name 'bash'
2019-05-31 16:48:53 +01:00
# Verify yarn
- ps: Write-Host "[+] Location of yarn ..."
- ps: Get-Command -Name 'yarn'
# Verify software versions
- ps: Write-Host "[+] Verifying software verisons ..."
- sh --version
- bash --version
- node --version
2019-05-31 16:48:53 +01:00
- yarn --version
2018-05-28 13:06:45 +10:00
#
# Python version will show "2.7" below, which is required to keep
# NPM's 'bunyan' > 'dtrace-provider' modules happy.
# 'Dtrace-provider' needs Python 'gyp' module, which is only
# available for Python-2. We will prepend Python-3.6 to $PATH,
# under 'build_script'.
#
- python --version
install:
2018-05-28 13:06:45 +10:00
#
# If there is a newer build queued for the same PR, cancel this
2018-05-28 13:06:45 +10:00
# one. The AppVeyor 'rollout builds' option is supposed to serve
# the same purpose but it is problematic because it tends to
# cancel builds pushed directly to master instead of just PR
2018-05-28 13:06:45 +10:00
# builds (or the converse).
#
# Credits: JuliaLang developers.
#
- ps: >-
$url = [string]::Format(
"{0}/{1}/{2}/{3}?{4}",
"https://ci.appveyor.com/api/projects",
$env:APPVEYOR_ACCOUNT_NAME,
$env:APPVEYOR_PROJECT_SLUG,
"history",
"recordsNumber=50"
);
`
if ($env:APPVEYOR_PULL_REQUEST_NUMBER `
-and $env:APPVEYOR_BUILD_NUMBER `
-ne ((Invoke-RestMethod $url).builds `
2018-05-28 13:06:45 +10:00
| Where-Object pullRequestId `
-eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) `
{ throw "Newer build in progress, giving this one up ..." }
# Change to build directory
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
# Verify CWD
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && ls -alh"
2019-05-31 16:48:53 +01:00
# Install yarn modules
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && yarn install"
build_script:
2018-05-28 13:06:45 +10:00
# Add Python-3.6 to %PATH%
- ps: $env:PATH = "C:\Python36-x64\Scripts;$env:PATH"
- ps: $env:PATH = "C:\Python36-x64;$env:PATH"
- ps: >-
Copy-Item `
-Path "C:\Python36-x64\Python.exe" `
-Destination "C:\Python36-x64\Python3.exe"
- python --version
2018-05-29 16:50:33 +10:00
# Install Python modules under Python 3.6
2018-05-29 21:35:38 +10:00
- ps: python -m pip install --upgrade pip>=10.0.1
- ps: python -m pip install --upgrade pyinstaller>=3.3.1
2018-05-29 16:50:33 +10:00
# Change to build directory and verify CWD
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
# Start build
2018-05-28 13:06:45 +10:00
- ps: Write-Host "[+] Current %PATH% under Bash ..."
- bash -e -l -c "echo $PATH"
2018-05-28 13:06:45 +10:00
- ps: Write-Host "[+] Current directory under Bash ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && ls -alh"
2018-05-28 13:06:45 +10:00
2019-05-31 16:48:53 +01:00
- ps: Write-Host "[+] Starting 'yarn run build' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && yarn run build"
test_script:
# Add Python-3.6 to %PATH%
- ps: $env:PATH = "C:\Python36-x64\Scripts;$env:PATH"
- ps: $env:PATH = "C:\Python36-x64;$env:PATH"
- ps: >-
Copy-Item `
-Path "C:\Python36-x64\Python.exe" `
-Destination "C:\Python36-x64\Python3.exe"
- python --version
# Install Python modules under Python 3.6
2018-05-29 21:35:38 +10:00
- ps: python -m pip install --upgrade pip>=10.0.1
- ps: python -m pip install --upgrade pyinstaller>=3.3.1
# Change to build directory and verify CWD
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Write-Host "[+] Current PowerShell directory is ..."
- ps: Get-Location
# Start build
- ps: Write-Host "[+] Current %PATH% under Bash ..."
- bash -e -l -c "echo $PATH"
- ps: Write-Host "[+] Current directory under Bash ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && ls -alh"
2019-05-31 16:48:53 +01:00
- ps: Write-Host "[+] Starting 'yarn run test' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && yarn run test"