2018-07-19 13:01:08 -03:00
|
|
|
# Build version
|
|
|
|
version: "{build}"
|
2019-07-25 08:22:41 -03:00
|
|
|
# do not shallow clone because we want to infer the version from the last tag
|
2018-07-19 13:01:08 -03:00
|
|
|
|
2018-08-01 15:03:03 -03:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- beta
|
|
|
|
- stable
|
|
|
|
|
2018-07-19 13:01:08 -03:00
|
|
|
# Build worker image (build VM template)
|
|
|
|
image: Visual Studio 2017
|
|
|
|
|
2019-04-07 10:28:21 -03:00
|
|
|
environment:
|
|
|
|
matrix:
|
|
|
|
- PX4_CONFIG: tests # this builds posix in px4_sitl_test folder and runs tests
|
|
|
|
- PX4_CONFIG: px4_fmu-v5_default
|
|
|
|
|
2018-07-19 13:01:08 -03:00
|
|
|
install:
|
2018-11-15 12:18:23 -04:00
|
|
|
# if the toolchain wasn't restored from build cache download and install it
|
|
|
|
- ps: >-
|
|
|
|
if (-not (Test-Path C:\PX4)) {
|
2019-11-29 11:14:34 -04:00
|
|
|
Invoke-WebRequest https://s3-us-west-2.amazonaws.com/px4-tools/PX4+Windows+Cygwin+Toolchain/PX4+Windows+Cygwin+Toolchain+0.8.msi -OutFile C:\Toolchain.msi
|
2018-11-15 12:18:23 -04:00
|
|
|
Start-Process -Wait msiexec -ArgumentList '/I C:\Toolchain.msi /quiet /qn /norestart /log C:\install.log'
|
|
|
|
}
|
|
|
|
|
|
|
|
# Note: using Start-Process -Wait is important
|
2018-07-26 04:42:31 -03:00
|
|
|
# because otherwise the install begins but non-blocking and the result cannot be used just after
|
|
|
|
|
2018-07-19 13:01:08 -03:00
|
|
|
build_script:
|
2018-11-25 11:25:02 -04:00
|
|
|
# FIXME Temporary we need to create the home folder because it's not contained in installer 0.5 and CI fails if it doesn't exist
|
2018-11-27 10:18:19 -04:00
|
|
|
- if not exist "C:\PX4\home" mkdir C:\PX4\home
|
2018-07-26 04:42:31 -03:00
|
|
|
# setup the environmental variables to work within the installed cygwin toolchain
|
2018-11-25 11:25:02 -04:00
|
|
|
- call C:\PX4\toolchain\scripts\setup-environment.bat x
|
2018-07-26 04:42:31 -03:00
|
|
|
# safe the repopath for switching to it in cygwin bash
|
|
|
|
- for /f %%i in ('cygpath -u %%CD%%') do set repopath=%%i
|
2019-04-07 10:28:21 -03:00
|
|
|
# build the make target
|
2019-07-25 08:22:41 -03:00
|
|
|
- call bash --login -c "cd $repopath && make $PX4_CONFIG"
|
2018-07-26 04:42:31 -03:00
|
|
|
|
|
|
|
# Note: using bash --login is important
|
|
|
|
# because otherwise certain things (like python; import numpy) do not work
|
2018-07-25 10:54:48 -03:00
|
|
|
|
|
|
|
cache:
|
2018-11-15 12:18:23 -04:00
|
|
|
# cache the entire toolchain installation folder to avoid
|
|
|
|
# downloading it from AWS S3 and installing the MSI each time
|
|
|
|
# it's ~1.8GB > 1GB free limit for build caches
|
|
|
|
- C:\PX4 -> appveyor.yml
|