diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..ba05fae0 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,20 @@ +# Without this "Update next build number or change version format." +version: "{build}" + +environment: + global: + BAZEL_ROOT: c:\bazel_root\ + INSTALL_CACHE: c:\install_cache\ + APPVEYOR_SAVE_CACHE_ON_ERROR: true + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + +install: + - set PATH=%PATH%;%INSTALL_CACHE% + - cmd: tools\appveyor\install.bat + +build_script: + - cmd: tools\appveyor\build.bat + +test_script: + - cmd: tools\appveyor\test.bat diff --git a/tools/appveyor/build.bat b/tools/appveyor/build.bat new file mode 100644 index 00000000..dfc8ef70 --- /dev/null +++ b/tools/appveyor/build.bat @@ -0,0 +1,22 @@ +REM Copyright 2018, OpenCensus Authors +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. + +REM TODO: Get everything to build on Windows: +REM bazel build //... + +REM TODO: Remove --output_user_root after https://github.com/bazelbuild/bazel/issues/4149 is fixed. +bazel --output_user_root=c:/t/ build //opencensus/trace + +IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +EXIT /b 0 diff --git a/tools/appveyor/install.bat b/tools/appveyor/install.bat new file mode 100644 index 00000000..3a18cfc8 --- /dev/null +++ b/tools/appveyor/install.bat @@ -0,0 +1,27 @@ +REM Copyright 2018, OpenCensus Authors +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. + +REM This script is based on: +REM https://github.com/google/xrtl/blob/master/tools/ci/appveyor/install.bat + +IF NOT EXIST %INSTALL_CACHE% (MKDIR %INSTALL_CACHE%) + +REM Download bazel into install cache, which is on the path. +IF NOT EXIST %INSTALL_CACHE%\bazel.exe ( + appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-without-jdk-windows-x86_64.exe -FileName %INSTALL_CACHE%\bazel.exe +) + +REM Temporary directory for bazel. +REM TODO: Remove this after https://github.com/bazelbuild/bazel/issues/4149 is fixed. +IF NOT EXIST C:\T (MKDIR C:\T) diff --git a/tools/appveyor/test.bat b/tools/appveyor/test.bat new file mode 100644 index 00000000..68dece09 --- /dev/null +++ b/tools/appveyor/test.bat @@ -0,0 +1,23 @@ +REM Copyright 2018, OpenCensus Authors +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. + +REM TODO: Make all tests pass on Windows: +REM bazel test //... + +REM TODO: Remove --output_user_root after https://github.com/bazelbuild/bazel/issues/4149 is fixed. +REM bazel --output_user_root=c:/t/ test //opencensus/trace:all +echo TODO: Make all tests pass on Windows. + +IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +EXIT /b 0