1# Appveyor, continuous integration for Windows
2# https://ci.appveyor.com/project/nedbat/coveragepy
3
4version: '{branch}-{build}'
5
6shallow_clone: true
7
8cache:
9  - '%LOCALAPPDATA%\pip\Cache'
10
11environment:
12
13  CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci\\run_with_env.cmd"
14
15  PYTEST_ADDOPTS: "-n auto"
16
17  # Note: There is logic to install Python version $PYTHON_VERSION if the
18  # $PYTHON directory doesn't exist.  $PYTHON_VERSION is visible in the job
19  # descriptions, but can be wrong in the minor version, since we use the
20  # version pre-installed on AppVeyor.
21  #
22  matrix:
23    - JOB: "2.7 64-bit"
24      TOXENV: "py27"
25      PYTHON: "C:\\Python27-x64"
26      PYTHON_VERSION: "2.7.17"
27      PYTHON_ARCH: "64"
28
29    - JOB: "3.5 64-bit"
30      TOXENV: "py35"
31      PYTHON: "C:\\Python35-x64"
32      PYTHON_VERSION: "3.5.9"
33      PYTHON_ARCH: "64"
34
35    - JOB: "3.6 64-bit"
36      TOXENV: "py36"
37      PYTHON: "C:\\Python36-x64"
38      PYTHON_VERSION: "3.6.9"
39      PYTHON_ARCH: "64"
40
41    - JOB: "3.7 64-bit"
42      TOXENV: "py37"
43      PYTHON: "C:\\Python37-x64"
44      PYTHON_VERSION: "3.7.5"
45      PYTHON_ARCH: "64"
46
47    - JOB: "3.8 64-bit"
48      TOXENV: "py38"
49      PYTHON: "C:\\Python38-x64"
50      PYTHON_VERSION: "3.8.0"
51      PYTHON_ARCH: "64"
52
53    - JOB: "3.9 64-bit"
54      TOXENV: "py39"
55      PYTHON: "C:\\Python39-x64"
56      PYTHON_VERSION: "3.9.0a3"
57      PYTHON_ARCH: "64"
58
59    # 32-bit jobs don't run the tests under the Python tracer, since that should
60    # be exactly the same as 64-bit.
61    - JOB: "2.7 32-bit"
62      TOXENV: "py27"
63      PYTHON: "C:\\Python27"
64      PYTHON_VERSION: "2.7.17"
65      PYTHON_ARCH: "32"
66      COVERAGE_NO_PYTRACER: "1"
67
68    - JOB: "3.5 32-bit"
69      TOXENV: "py35"
70      PYTHON: "C:\\Python35"
71      PYTHON_VERSION: "3.5.9"
72      PYTHON_ARCH: "32"
73      COVERAGE_NO_PYTRACER: "1"
74
75    - JOB: "3.6 32-bit"
76      TOXENV: "py36"
77      PYTHON: "C:\\Python36"
78      PYTHON_VERSION: "3.6.9"
79      PYTHON_ARCH: "32"
80      COVERAGE_NO_PYTRACER: "1"
81
82    - JOB: "3.7 32-bit"
83      TOXENV: "py37"
84      PYTHON: "C:\\Python37"
85      PYTHON_VERSION: "3.7.5"
86      PYTHON_ARCH: "32"
87      COVERAGE_NO_PYTRACER: "1"
88
89    - JOB: "3.8 32-bit"
90      TOXENV: "py38"
91      PYTHON: "C:\\Python38"
92      PYTHON_VERSION: "3.8.0"
93      PYTHON_ARCH: "32"
94      COVERAGE_NO_PYTRACER: "1"
95
96    - JOB: "3.9 32-bit"
97      TOXENV: "py39"
98      PYTHON: "C:\\Python39"
99      PYTHON_VERSION: "3.9.0a3"
100      PYTHON_ARCH: "32"
101      COVERAGE_NO_PYTRACER: "1"
102
103    # Meta coverage
104    - JOB: "Meta 2.7"
105      TOXENV: "py27"
106      PYTHON: "C:\\Python27"
107      PYTHON_VERSION: "2.7.17"
108      PYTHON_ARCH: "32"
109      COVERAGE_COVERAGE: "yes"
110
111    - JOB: "Meta 3.6"
112      TOXENV: "py36"
113      PYTHON: "C:\\Python36"
114      PYTHON_VERSION: "3.6.9"
115      PYTHON_ARCH: "32"
116      COVERAGE_COVERAGE: "yes"
117
118init:
119  - "ECHO %TOXENV%"
120
121install:
122  # Install Python (from the official .msi of http://python.org) and pip when
123  # not already installed.
124  - ps: if (-not(Test-Path($env:PYTHON))) { & ci\install.ps1 }
125
126  # Prepend newly installed Python to the PATH of this build (this cannot be
127  # done from inside the powershell script as it would require to restart
128  # the parent CMD process).
129  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
130
131  # Check that we have the expected version and architecture for Python
132  - "python -c \"import struct, sys; print('{}\\n{}-bit'.format(sys.version, struct.calcsize('P') * 8))\""
133
134  # Upgrade to the latest version of pip to avoid it displaying warnings
135  # about it being out of date.
136  - "python -m pip install --disable-pip-version-check --upgrade pip"
137  # And upgrade virtualenv to get the latest pip inside .tox virtualenvs.
138  - "python -m pip install --disable-pip-version-check --upgrade virtualenv"
139
140  # Install requirements.
141  - "%CMD_IN_ENV% pip install -r requirements/ci.pip"
142
143  # Make a pythonX.Y.bat file in the current directory so that tox will find it
144  # and pythonX.Y will mean what we want it to.
145  - "python -c \"import os; open('python{}.{}.bat'.format(*os.environ['TOXENV'][2:]), 'w').write('@{}\\\\python \\x25*\\n'.format(os.environ['PYTHON']))\""
146
147build_script:
148  # If not a metacov job, then build wheel installers.
149  - if NOT "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% %PYTHON%\python setup.py bdist_wheel
150
151  # Push everything in dist\ as an artifact.
152  - ps: if ( Test-Path 'dist' -PathType Container ) { Get-ChildItem dist\*.* | % { Push-AppveyorArtifact $_.FullName -FileName ('dist\' + $_.Name) } }
153
154test_script:
155  - "%CMD_IN_ENV% %PYTHON%\\Scripts\\tox"
156
157after_test:
158  - if "%COVERAGE_COVERAGE%" == "yes" 7z a metacov-win-%TOXENV%.zip %APPVEYOR_BUILD_FOLDER%\.metacov*
159  - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% %PYTHON%\python igor.py combine_html
160  - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% pip install codecov
161  - if "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% codecov -X gcov --file coverage.xml
162
163# Uncomment this to enable RDP access to the build when done.
164# https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
165# on_finish:
166#   - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
167
168artifacts:
169  - path: "metacov-*.zip"
170