-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
74 lines (65 loc) · 2.49 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
environment:
matrix:
# Unit and integration tests.
- PYTHON: "C:\\Python27"
RUN_INTEGRATION_TESTS: "True"
- PYTHON: "C:\\Python36-x64"
RUN_INTEGRATION_TESTS: "True"
# Unit tests only.
- PYTHON: "C:\\Python27-x64"
- PYTHON: "C:\\Python34"
- PYTHON: "C:\\Python34-x64"
- PYTHON: "C:\\Python35"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36"
matrix:
fast_finish: true
clone_depth: 50
install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "python --version"
- "python -m pip install --upgrade --disable-pip-version-check pip setuptools wheel"
- "pip install --upgrade certifi tox tox-venv"
- "pip freeze --all"
# Fix git SSL errors.
- "python -m certifi >cacert.txt"
- "set /p GIT_SSL_CAINFO=<cacert.txt"
- "set GIT_SSL_CAINFO"
build: off
cache:
- '%LOCALAPPDATA%\pip\Cache'
test_script:
- ps: |
$ErrorActionPreference = "Stop"
function should_run_tests {
if ("$env:APPVEYOR_PULL_REQUEST_NUMBER" -eq "") {
Write-Host "Not a pull request - running tests"
return $true
}
Write-Host "Pull request $env:APPVEYOR_PULL_REQUEST_NUMBER based on branch $env:APPVEYOR_REPO_BRANCH"
git fetch -q origin +refs/heads/$env:APPVEYOR_REPO_BRANCH
$changes = (git diff --name-only HEAD (git merge-base HEAD FETCH_HEAD))
Write-Host "Files changed:"
Write-Host $changes
$important = $changes | Where-Object { $_ -NotLike "*.rst" } |
Where-Object { $_ -NotLike "docs*" } |
Where-Object { $_ -NotLike "news*" } |
Where-Object { $_ -NotLike "*travis*" } |
Where-Object { $_ -NotLike ".github*" }
if (!$important) {
Write-Host "Only documentation changes - skipping tests"
return $false
}
Write-Host "Pull request $env:APPVEYOR_PULL_REQUEST_NUMBER alters code - running tests"
return $true
}
if (should_run_tests) {
# Shorten paths, workaround https://bugs.python.org/issue18199
subst T: $env:TEMP
$env:TEMP = "T:\"
$env:TMP = "T:\"
tox -e py -- -m unit
if ($LastExitCode -eq 0 -and $env:RUN_INTEGRATION_TESTS -eq "True") {
tox -e py -- --use-venv -m integration -n2 --durations=20
}
}