[CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH (#5827)
[platform/upstream/flatbuffers.git] / appveyor.yml
1 branches:
2   only:
3     - master
4
5 environment:
6
7   global:
8     # Workaround for https://github.com/conda/conda-build/issues/636
9     PYTHONIOENCODING: UTF-8
10     CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64"
11     CMAKE_OPTIONS: ""
12     CPP_TEST_OPTIONS: ""
13
14   matrix:
15     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
16       CMAKE_VS_VERSION: "10 2010"
17       CMAKE_OPTIONS: "-DFLATBUFFERS_BUILD_LEGACY=1"
18       CPP_TEST_OPTIONS: "--std-cpp c++0x"
19       MONSTER_EXTRA: "skip"
20
21     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
22       CMAKE_VS_VERSION: "12 2013"
23       MONSTER_EXTRA: "skip"
24
25     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
26       CMAKE_VS_VERSION: "14 2015"
27       MONSTER_EXTRA: ""
28
29     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
30       CMAKE_VS_VERSION: "15 2017"
31       CMAKE_OPTIONS: "-DFLATBUFFERS_ENABLE_PCH=1"
32       MONSTER_EXTRA: ""
33
34     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
35       CMAKE_VS_VERSION: "16 2019"
36       CMAKE_OPTIONS: "-DFLATBUFFERS_ENABLE_PCH=1"
37       MONSTER_EXTRA: ""
38
39 platform:
40   - x86
41   - x64
42
43 configuration:
44   - Debug
45   - Release
46
47 before_build:
48   - set MONSTER_EXTRA=%MONSTER_EXTRA%
49   - cmake . -G"Visual Studio %CMAKE_VS_VERSION%" -DFLATBUFFERS_CODE_SANITIZE=1 %CMAKE_OPTIONS%
50   # This cuts down on a lot of noise generated by xamarin warnings.
51   - if exist "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
52   - if exist "C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
53   - if exist "C:\Program Files (x86)\MSBuild\16.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets" del "C:\Program Files (x86)\MSBuild\16.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
54
55 build:
56   project: ALL_BUILD.vcxproj
57   verbosity: minimal
58
59 after_build:
60   - python conan/appveyor/install.py
61   - python conan/appveyor/build.py
62
63 install:
64   - set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
65   - curl -sSf -o rustup-init.exe https://win.rustup.rs/
66   - rustup-init.exe -y
67   - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
68   - rustc -V
69   - cargo -V
70
71 test_script:
72   - call .appveyor\check-generate-code.bat -b %CONFIGURATION%
73   - "cd tests"
74   - rem "Building all code"
75   - generate_code.bat -b %CONFIGURATION% %CPP_TEST_OPTIONS%
76   - 7z a GeneratedMyGameCode.zip MyGame\
77   - rem "---------------- C++ -----------------"
78   - "cd .."
79   - "%CONFIGURATION%\\flattests.exe"
80   - "cd tests"
81   - rem "---------------- Java -----------------"
82   - "java -version"
83   - "JavaTest.bat"
84   - rem "---------------- Rust ----------------"
85   - "RustTest.bat"
86   - rem "---------------- JS -----------------"
87   - "node --version"
88   - "..\\%CONFIGURATION%\\flatc -b -I include_test monster_test.fbs unicode_test.json"
89   - "node JavaScriptTest ./monster_test_generated"
90   - rem "-------------- Python ---------------"
91   - where python
92   - python --version
93   - where pip
94   - pip --version
95   - where conda
96   - conda --version
97   - rem "installing flatbuffers python library"
98   - pip install ../python
99   - rem "testing without installing Numpy"
100   - python py_test.py 0 0 0
101   - rem "testing after installing Numpy - disabled"
102   # FIXME: This has a LOT of unnecessary dependencies and makes the tests fail
103   # with timeouts.
104   # - conda install --yes numpy
105   # - python py_test.py 0 0 0
106   - rem "---------------- C# -----------------"
107   # Have to compile this here rather than in "build" above because AppVeyor only
108   # supports building one project??
109   - "cd FlatBuffers.Test"
110   - "copy ..\\monsterdata_test.mon Resources\\"
111   - "copy ..\\monsterdata_test.json Resources\\"
112   - "dotnet new sln"
113   - "dotnet sln add FlatBuffers.Test.csproj"
114   - "nuget restore"
115   - "msbuild.exe /property:Configuration=Release;OutputPath=tempcs /verbosity:minimal FlatBuffers.Test.csproj"
116   - "tempcs\\FlatBuffers.Test.exe"
117   # Run tests with UNSAFE_BYTEBUFFER
118   - "msbuild.exe /property:Configuration=Release;UnsafeByteBuffer=true;OutputPath=tempcsUnsafe /verbosity:minimal FlatBuffers.Test.csproj"
119   - "tempcsUnsafe\\FlatBuffers.Test.exe"
120   # TODO: add more languages.
121   - "cd ..\\.."
122
123 artifacts:
124   - path: $(CONFIGURATION)\flatc.exe
125     name: flatc.exe
126   - path: tests\GeneratedMyGameCode.zip
127     name: GeneratedMyGameCode.zip