forked from opensim-org/opensim-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
141 lines (117 loc) · 6.38 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
135
136
137
138
139
140
141
# Windows testing using Visual Studio.
# Syntax for this file:
# http://www.appveyor.com/docs/appveyor-yml
# See http://msdn.microsoft.com/en-us/library/ms164311.aspx for
# command-line options to MSBuild.
# Speeding up a Visual Studio build.
# http://blogs.msdn.com/b/vcblog/archive/2011/01/05/damn-my-vc-project-is-building-slower-in-vs2010-what-do-i-do-now-a-step-by-step-guide.aspx
shallow_clone: true
image: Visual Studio 2017
platform: x64
# No need to run CI on the branch if we're also running CI for a PR.
skip_branch_with_pr: true
nuget:
disable_publish_on_pr: true
environment:
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
JAVA_DIR: "C:\\Program Files\\Java\\jdk1.8.0"
PYTHON_DIR: "C:\\Python27-x64"
matrix:
- CMAKE_TOOLSET: "v140"
NUGET_PACKAGE_ID_SUFFIX: "-VC140"
- CMAKE_TOOLSET: "v141"
NUGET_PACKAGE_ID_SUFFIX: "-VC141"
branches:
except:
# Branches containing Development Proposals do not need to be tested.
# Exclude any branch whose name starts with devprop (case-insensitive).
# For example, devprop-feature and DEVPROP_feature are ignored.
# The forward slashes indicate to AppVeyor that we are giving a regex.
- /^(?i:devprop).*$/
init:
# Note: python 2.7 32bit is already on the path. We want v2.7 64bit,
# so we must add v2.7 64bit earlier on the PATH so that CMake finds it when
# configuring.
# The Scripts directory is for putting nosetests on the path.
# http://www.appveyor.com/docs/installed-software
- SET PATH=%PYTHON_DIR%;%PATH%
- SET OPENSIM_SOURCE_DIR=C:\projects\opensim-core
- SET OPENSIM_BUILD_DIR=C:\projects\opensim_build
- SET OPENSIM_INSTALL_DIR=C:\projects\opensim_install
- SET OPENSIM_DEPENDENCIES_SOURCE_DIR=%OPENSIM_SOURCE_DIR%\dependencies
- SET OPENSIM_DEPENDENCIES_BUILD_DIR=C:\projects\opensim_dependencies_build
- SET OPENSIM_DEPENDENCIES_INSTALL_DIR=C:\projects\opensim_dependencies_install
# The CMake variable JAVA_HOME tells CMake where to look for Java.
- SET JAVA_HOME=%JAVA_DIR%
- SET PATH=%JAVA_HOME%\bin;%PATH%
# Detect if we are on the master branch; if so, we will deploy binaries.
- IF %APPVEYOR_REPO_BRANCH% EQU master IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER SET DISTR=TRUE
cache:
## Cache swig, which we install via AppVeyor.
# The syntax here is <dir-to-cache> -> <invalidated-when-this-file-changes>
# If the appveyor.yml script is changed, then the cache is invalidated.
# https://www.appveyor.com/docs/build-cache/
- C:\ProgramData\chocolatey\bin -> appveyor.yml # swig.exe
- C:\ProgramData\chocolatey\lib -> appveyor.yml # supporting swig Lib files.
install:
- cmake --version
## Use Chocolatey to install SWIG.
# Only install swig if it isn't present (as a result of AppVeyor's caching).
# SWIG 3.0.8 is the minimum required version, but it does not yet exist in
# Chocolatey.
- IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install swig --version 3.0.9 --yes --limit-output #> $null
## Install python-nose for python testing.
- "%PYTHON_DIR%\\Scripts\\pip install nose"
## Simbody.
# Simbody's installation is pushed to our Appveyor NuGet account feed.
# Must use version 0.0.0, otherwise, nuget will use nuget.org, where
# chrisdembia once uploaded a simbody 3.5.0 nupkg.
# Output directory must match how Simbody was packaged, otherwise
# SimbodyConfig.cmake will have all the wrong paths.
# http://help.appveyor.com/discussions/problems/6024-build-stalled-prompting-for-nuget-permissions#comment_41867748
# The URL is for the public project feed that AppVeyor creates for the simbody project, obtained
# from https://ci.appveyor.com/project/opensim-org/simbody/settings/nuget.
- nuget sources add -name simbody -source https://ci.appveyor.com/nuget/simbody-9iv11sycwdny
- nuget install simbody%NUGET_PACKAGE_ID_SUFFIX% -Version 0.0.0 -ExcludeVersion -OutputDirectory C:\
build_script:
## Superbuild dependencies.
- mkdir %OPENSIM_DEPENDENCIES_BUILD_DIR%
- cd %OPENSIM_DEPENDENCIES_BUILD_DIR%
- cmake %OPENSIM_DEPENDENCIES_SOURCE_DIR% -G"%CMAKE_GENERATOR%" -T"%CMAKE_TOOLSET%" -DCMAKE_INSTALL_PREFIX=%OPENSIM_DEPENDENCIES_INSTALL_DIR% -DSUPERBUILD_simbody=OFF
- cmake --build . --config Release -- /maxcpucount:4 /verbosity:quiet
- mkdir %OPENSIM_BUILD_DIR%
## Configure and build OpenSim.
# Must create separate build dir, otherwise can't read test files
# for some reason.
- cd %OPENSIM_BUILD_DIR%
# Configure. # TODO -DBUILD_SIMM_TRANSLATOR=ON
# Set the CXXFLAGS environment variable to turn warnings into errors.
- cmake -E env CXXFLAGS="/WX" cmake %OPENSIM_SOURCE_DIR% -G"%CMAKE_GENERATOR%" -T"%CMAKE_TOOLSET%" -DSIMBODY_HOME=C:\simbody%NUGET_PACKAGE_ID_SUFFIX% -DOPENSIM_DEPENDENCIES_DIR=%OPENSIM_DEPENDENCIES_INSTALL_DIR% -DCMAKE_INSTALL_PREFIX=%OPENSIM_INSTALL_DIR% -DBUILD_JAVA_WRAPPING=ON -DBUILD_PYTHON_WRAPPING=ON -DWITH_BTK:BOOL=ON
# Build.
- cmake --build . --config Release -- /maxcpucount:4 /verbosity:quiet #/p:TreatWarningsAsErrors="true"
test_script:
## Run tests.
- ctest --parallel 4 --build-config Release --output-on-failure #--exclude-regex "%OPENSIM_TESTS_TO_EXCLUDE%"
## Build doxygen (now that tests pass).
# http://help.appveyor.com/discussions/problems/863-doxygen-installed-via-chocolatey-not-found
- IF DEFINED DISTR choco install doxygen.portable --yes
- IF DEFINED DISTR cmake .
- IF DEFINED DISTR cmake --build . --target doxygen --config Release
## Ensure we have no trouble installing.
- cmake --build . --target install --config Release -- /maxcpucount:4 /verbosity:quiet
## Test python wrapping.
- set PATH=%OPENSIM_INSTALL_DIR%\bin;%PATH%
# Move to the installed location of the python package.
- cd %OPENSIM_INSTALL_DIR%\sdk\python
# Run python tests.
- "%PYTHON_DIR%\\Scripts\\nosetests -v" #--exclude=%PYTHON_TESTS_TO_EXCLUDE%"
after_test:
- cd %APPVEYOR_BUILD_FOLDER%
- ## On master branch, create NuGet package for OpenSim.
- # Create and upload NuGet package.
- IF DEFINED DISTR nuget pack .opensim-core.nuspec -Properties "packageIdSuffix=%NUGET_PACKAGE_ID_SUFFIX%" -BasePath %OPENSIM_INSTALL_DIR%
- IF DEFINED DISTR appveyor PushArtifact opensim-core%NUGET_PACKAGE_ID_SUFFIX%.0.0.0.nupkg
# The following, if uncommented, should allow you to remote-desktop into
# the Appveyor build machine.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))