-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add appveyor.yml for Windows CI (#3)
Add appveyor.yml for windows CI
- Loading branch information
Showing
2 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Build only the master branch, tagged commits, and pull requests | ||
branches: | ||
only: | ||
- master | ||
- /\d+\.\d+.*/ | ||
|
||
# Don't run the (redundant) branch build with a pull request | ||
skip_branch_with_pr: true | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
environment: | ||
global: | ||
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the | ||
# /E:ON and /V:ON options are not enabled in the batch script intepreter | ||
# See: http://stackoverflow.com/a/13751649/163740 | ||
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" | ||
|
||
PYTHONUNBUFFERED: 1 | ||
COVERAGE_DIR: "" | ||
MINICONDA: C:\\Miniconda3-x64 | ||
|
||
matrix: | ||
- PYTHON_VERSION: 3.7 | ||
- PYTHON_VERSION: 3.6 | ||
|
||
|
||
init: | ||
# 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: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` | ||
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` | ||
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` | ||
throw "There are newer queued builds for this pull request, failing early." } | ||
- ps: | | ||
If (($env:SKIP_NOTAG -eq "true") -and ($env:APPVEYOR_REPO_TAG -ne "true")) { | ||
throw "Skipping Python version, not a tag." | ||
} | ||
install: | ||
# conda 4.5.11 seems to expect that this directory exists already | ||
- mkdir C:\Users\appveyor\.conda | ||
- call %MINICONDA%\Scripts\activate.bat | ||
# The safety checks are simply intended to ensure that there is enough disk space | ||
# and the user has the necessary permissions to make environment changes. In a CI | ||
# environment these are not necessary and slow things down noticeably on Windows. | ||
- conda config --set always_yes yes --set changeps1 no --set auto_update_conda no --set safety_checks disabled | ||
- conda install -q conda pip | ||
- conda info -a | ||
|
||
# Upgrade to the latest version of pip to avoid it displaying warnings | ||
# about it being out of date. | ||
- pip install --upgrade pip | ||
|
||
# Create a conda environment using the required packages. | ||
- conda create -q --yes -n test python=%PYTHON_VERSION% pytorch scipy -c pytorch | ||
- activate test | ||
- pip install pytest pytest-cov codecov | ||
# list package versions | ||
- conda list | ||
# Using pip instead of setup.py ensures we install a non-compressed version of the package | ||
# (as opposed to an egg), which is necessary to collect coverage. | ||
# We still get the benefit of testing an installed version over the | ||
# test version to iron out installation file-inclusion bugs but can | ||
# also collect coverage. | ||
- pip install . | ||
|
||
# Not a .NET project, build in the install setup | ||
build: false | ||
|
||
test_script: | ||
- pytest tests | ||
|