1
1
version : 1.0.{build}
2
2
max_jobs : 2
3
- image : Visual Studio 2015
4
3
4
+ # Reducing build load and CI time by specifying the exact test matrix.
5
5
environment :
6
- nodejs_version : " 6"
6
+ nodejs_version : " LTS"
7
+ matrix :
8
+ - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2015
9
+ PLATFORM_TOOLSET : v140
10
+ CONFIGURATION : Debug
11
+ PLATFORM : x64
12
+ - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2015
13
+ PLATFORM_TOOLSET : v140
14
+ CONFIGURATION : Debug
15
+ PLATFORM : ARM
16
+ - APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2017
17
+ PLATFORM_TOOLSET : v141
18
+ CONFIGURATION : ReleaseBundle
19
+ PLATFORM : x86
20
+
21
+ # Uncomment to enable entire matrix of tests.
22
+ # image:
23
+ # - Visual Studio 2015
24
+ # - Visual Studio 2017
25
+ # configuration:
26
+ # - Debug
27
+ # - ReleaseBundle
28
+ # - DebugBundle
29
+ # - Release
30
+ # platform:
31
+ # - x86
32
+ # - x64
33
+ # - ARM
34
+
35
+ matrix :
36
+ # Fail everything immediately if one build fails.
37
+ fast_finish : true
7
38
8
39
hosts :
9
40
api.nuget.org : 93.184.221.200
@@ -18,46 +49,60 @@ install:
18
49
- ps : ' [IO.Compression.ZipFile]::ExtractToDirectory("C:\winium.zip", "C:\winium")'
19
50
20
51
clone_script :
21
- - ps : git clone -q $("--branch=" + $Env :APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env :APPVEYOR_REPO_NAME + ".git") $Env :APPVEYOR_BUILD_FOLDER
22
- - ps : if (!$Env :APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env :APPVEYOR_REPO_COMMIT)}
23
- - ps : if ($Env :APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env :APPVEYOR_PULL_REQUEST_NUMBER)/merge; git checkout -qf FETCH_HEAD}
52
+ - ps : git clone -q $("--branch=" + $env :APPVEYOR_REPO_BRANCH) $("https://github.com/" + $env :APPVEYOR_REPO_NAME + ".git") $env :APPVEYOR_BUILD_FOLDER
53
+ - ps : if (!$env :APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $env :APPVEYOR_REPO_COMMIT)}
54
+ - ps : if ($env :APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($env :APPVEYOR_PULL_REQUEST_NUMBER)/merge; git checkout -qf FETCH_HEAD}
24
55
- ps : git submodule update -q --init --recursive
25
56
26
57
before_build :
27
- - ps : $env:playgroundNet46_dir=$Env :APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46"
28
- - ps : $env:bundle_dir=$Env :APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46\ReactAssets"
58
+ - ps : $env:playgroundNet46_dir=$env :APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46"
59
+ - ps : $env:bundle_dir=$env :APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46\ReactAssets"
29
60
- ps : nuget restore ReactWindows\ReactNative.sln
30
61
- npm i -g react-native-cli
31
62
32
63
build_script :
33
64
- ps : mkdir $env:bundle_dir
34
65
- ps : react-native bundle --platform windows --entry-file $($env:playgroundNet46_dir + "\index.windows.js") --bundle-output $($env:bundle_dir + "\index.windows.bundle") --assets-dest $env:bundle_dir --dev false; echo "Suppressing error"
35
- - cmd : >-
36
- set DEVENV="%VS140COMNTOOLS%\..\IDE\devenv"
37
-
38
- %DEVENV% /build "Debug|x86" ReactWindows\ReactNative.sln
39
-
40
- %DEVENV% /build "ReleaseBundle|x64" ReactWindows\ReactNative.sln
41
-
42
- %DEVENV% /build "Debug|ARM" ReactWindows\ReactNative.sln
66
+ - ps : msbuild /p:Configuration=$env:CONFIGURATION /p:Platform=$env:PLATFORM /p:PlatformToolset=$env:PLATFORM_TOOLSET /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" "ReactWindows\ReactNative.sln"
43
67
44
68
# Start Winium in the background, give it a moment to start
45
69
before_test :
46
70
- ps : $winium = Start-Process -PassThru C:\winium\Winium.Desktop.Driver.exe
47
71
- ps : Start-Sleep -s 5
48
72
49
- test :
50
- assemblies :
51
- - ReactWindows\ReactNative.Net46.Tests\bin\x64\**\*.Tests.dll
52
-
53
73
test_script :
54
- # - npm run flow-check
55
- - npm test
74
+ # Run Nunit 3.x test engine and output to AppVeyor's UI.
75
+ - ps : >-
76
+ $platform = Get-ChildItem Env:PLATFORM
77
+
78
+ $platform = $platform.value
79
+
80
+ $config = Get-ChildItem Env:CONFIGURATION
81
+
82
+ if($config.value -eq "ReleaseBundle") { $config = "Release" } elseif ($config -eq "DebugBundle") { $config = "Debug" } else { $config = $config.value }
83
+
84
+ if($platform -ne "ARM") { nunit3-console "ReactWindows\ReactNative.Net46.Tests\bin\$platform\$config\ReactNative.Net46.Tests.dll" --result=myresults.xml }
85
+
86
+ if ($platform -eq "ReleaseBundle" -Or $platform -eq "DebugBundle") { npm test }
87
+
88
+ # Disabling for now
89
+ # - npm run flow-check
90
+ # Spec test only works when there is a bundle
91
+
56
92
- npm run lint
57
93
58
94
after_test :
59
- - ps : Stop-Process -Id $winium.Id
60
- - ReactWindows\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"ReactWindows\packages\NUnit.ConsoleRunner.3.5.0\tools\nunit3-console.exe" -targetargs:"ReactWindows\ReactNative.Net46.Tests\bin\x86\Debug\ReactNative.Net46.Tests.dll" -output:ReactWindows_coverage.xml
95
+ - ps : >-
96
+ Stop-Process -Id $winium.Id
97
+
98
+ $platform = Get-ChildItem Env:PLATFORM
99
+
100
+ $config = Get-ChildItem Env:CONFIGURATION
101
+
102
+ if($config.value -eq "ReleaseBundle") { $config = "Release" } elseif ($config -eq "DebugBundle") { $config = "Debug" } else { $config = $config.value }
103
+
104
+ if ($platform.value -ne "ARM") { ReactWindows\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"ReactWindows\packages\NUnit.ConsoleRunner.3.5.0\tools\nunit3-console.exe" -targetargs:"ReactWindows\ReactNative.Net46.Tests\bin\$env:PLATFORM\$config\ReactNative.Net46.Tests.dll" -output:ReactWindows_coverage.xml }
105
+
61
106
- " SET PATH=C:\\ Python34;C:\\ Python34\\ Scripts;%PATH%"
62
107
- pip install codecov
63
108
- codecov -f "ReactWindows_coverage.xml"
0 commit comments