forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
104 lines (82 loc) · 4.09 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
version: 1.0.{build}
max_jobs: 2
# Reducing build load and CI time by specifying the exact test matrix.
environment:
nodejs_version: "LTS"
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONFIGURATION: Debug
PLATFORM: x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONFIGURATION: Debug
PLATFORM: ARM
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CONFIGURATION: ReleaseBundle
PLATFORM: x86
# Uncomment to enable entire matrix of tests.
#image:
# - Visual Studio 2017
#configuration:
# - Debug
# - ReleaseBundle
# - DebugBundle
# - Release
#platform:
# - x86
# - x64
# - ARM
matrix:
# Fail everything immediately if one build fails.
fast_finish: true
hosts:
api.nuget.org: 93.184.221.200
install:
- ps: Install-Product node $env:nodejs_version x64
- appveyor-retry npm install -g npm@lts
- appveyor-retry npm i
- ps: curl -o C:\winium.zip https://github.com/2gis/Winium.Desktop/releases/download/v1.6.0/Winium.Desktop.Driver.zip
- ps: mkdir C:\winium
- ps: Add-Type -A 'System.IO.Compression.FileSystem'
- ps: '[IO.Compression.ZipFile]::ExtractToDirectory("C:\winium.zip", "C:\winium")'
clone_script:
- ps: git clone -q $("--branch=" + $env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $env:APPVEYOR_REPO_NAME + ".git") $env:APPVEYOR_BUILD_FOLDER
- ps: if (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $env:APPVEYOR_REPO_COMMIT)}
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($env:APPVEYOR_PULL_REQUEST_NUMBER)/merge; git checkout -qf FETCH_HEAD}
- appveyor-retry git submodule update -q --init --recursive
before_build:
- ps: $env:playgroundNet46_dir=$env:APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46"
- ps: $env:bundle_dir=$env:APPVEYOR_BUILD_FOLDER + "\ReactWindows\Playground.Net46\ReactAssets"
- appveyor-retry nuget restore ReactWindows\ReactNative.sln
- appveyor-retry npm i -g react-native-cli
build_script:
- ps: mkdir $env:bundle_dir
- 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"
- ps: msbuild /p:Configuration=$env:CONFIGURATION /p:Platform=$env:PLATFORM /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" "ReactWindows\ReactNative.sln"
# Start Winium in the background, give it a moment to start
before_test:
- ps: $winium = Start-Process -PassThru C:\winium\Winium.Desktop.Driver.exe
- ps: Start-Sleep -s 5
test_script:
# Run Nunit 3.x test engine and output to AppVeyor's UI.
- ps: >-
$platform = Get-ChildItem Env:PLATFORM
$platform = $platform.value
$config = Get-ChildItem Env:CONFIGURATION
if($config.value -eq "ReleaseBundle") { $config = "Release" } elseif ($config -eq "DebugBundle") { $config = "Debug" } else { $config = $config.value }
if($platform -ne "ARM") { nunit3-console --where "cat!=Network" "ReactWindows\ReactNative.Net46.Tests\bin\$platform\$config\ReactNative.Net46.Tests.dll" --result=myresults.xml }
if ($platform -eq "ReleaseBundle" -Or $platform -eq "DebugBundle") { npm test }
# Disabling for now
#- npm run flow-check
# Spec test only works when there is a bundle
#
# - npm run lint
after_test:
- ps: >-
Stop-Process -Id $winium.Id
$platform = Get-ChildItem Env:PLATFORM
$config = Get-ChildItem Env:CONFIGURATION
if($config.value -eq "ReleaseBundle") { $config = "Release" } elseif ($config -eq "DebugBundle") { $config = "Debug" } else { $config = $config.value }
if ($platform.value -ne "ARM") { ReactWindows\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"ReactWindows\packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe" "-targetargs:""--where cat!=Network" ReactWindows\ReactNative.Net46.Tests\bin\$env:PLATFORM\$config\ReactNative.Net46.Tests.dll"" -output:ReactWindows_coverage.xml }
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f "ReactWindows_coverage.xml"