forked from tridactyl/tridactyl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
134 lines (111 loc) · 4.13 KB
/
.appveyor.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
# 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'
# 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
- yarn --version
#
# 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:
#
# If there is a newer build queued for the same PR, cancel this
# 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
# 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 `
| 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"
# Install yarn modules
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && yarn install"
build_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
- 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"
- 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
- 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"
- ps: Write-Host "[+] Starting 'yarn run test' ..."
- bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && export PYINSTALLER=1 && yarn run test"