-
Notifications
You must be signed in to change notification settings - Fork 6
/
appveyor.yml
117 lines (85 loc) · 3.67 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
105
106
107
108
109
110
111
112
113
114
115
116
117
version: 1.0.{build}
branches:
only:
- x64_support
- master
image: Visual Studio 2017
environment:
matrix:
- PlatformToolset: v141_xp
configuration:
- Release
- Debug
platform:
- x86
- x64
install:
- if "%platform%"=="x64" set archi=amd64
- if "%platform%"=="x64" set platform_input=x64
- if "%platform%"=="x86" set archi=x86
- if "%platform%"=="x86" set platform_input=Win32
- if "%PlatformToolset%"=="v141_xp" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi%
before_build:
- cmd: >-
git clone https://github.com/google/googletest
cd googletest && mkdir build && cd build
echo "PLATFORM=%PLATFORM%"
echo "CONFIGURATION=%CONFIGURATION%"
IF "%PLATFORM%"=="x86" (SET CMAKE_COMPILER="Visual Studio 15 2017") ELSE (SET CMAKE_COMPILER="Visual Studio 15 2017 Win64")
echo "CMAKE_COMPILER=%CMAKE_COMPILER%"
cmake -Dgtest_force_shared_crt=OFF -DCMAKE_INSTALL_PREFIX=c:\projects\googletest_release\%PLATFORM% -G %CMAKE_COMPILER% ..
cmake --build . --target install --config %CONFIGURATION%
cd ..\..
python GenerateVersionHeader.py %APPVEYOR_BUILD_VERSION% > NppSaveAsAdmin\src\plugin\SaveAsAdminVersion.hpp
build_script:
- cmd: cd "%APPVEYOR_BUILD_FOLDER%"
- cmd: msbuild UnitTests/UnitTests.vcxproj /m /p:configuration="%configuration%" /p:platform="%platform_input%" /p:PlatformToolset="%PlatformToolset%" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
- cmd: cd "%APPVEYOR_BUILD_FOLDER%"
- ps: >-
if ($env:CONFIGURATION -eq "Release") {
if($env:PLATFORM -eq "x64") {
$ZipFileName = "NppSaveAsAdmin_$($env:APPVEYOR_BUILD_VERSION)_x64.zip"
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\NppSaveAsAdmin\bin64\NppSaveAsAdmin.dll"
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\NppSaveAsAdmin\bin64\NppAdminAccess.exe"
}
if($env:PLATFORM -eq "x86") {
$ZipFileName = "NppSaveAsAdmin_$($env:APPVEYOR_BUILD_VERSION)_x86.zip"
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\NppSaveAsAdmin\bin\NppSaveAsAdmin.dll"
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\NppSaveAsAdmin\bin\NppAdminAccess.exe"
}
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\README.md"
7z a $ZipFileName "$($env:APPVEYOR_BUILD_FOLDER)\NppSaveAsAdmin\license.txt"
}
test_script:
- ps: >-
$BASE_EXE_PATH = "C:\projects\nppsaveasadmin\UnitTests\"
if ("$env:PLATFORM" -eq "x64") {$BASE_EXE_PATH = $BASE_EXE_PATH + "x64\"}
$TEST_EXE_PATH = $BASE_EXE_PATH + $env:CONFIGURATION + "\UnitTests.exe"
echo "test exe = $TEST_EXE_PATH"
& $TEST_EXE_PATH --gtest_output="xml:C:\projects\test_results.xml"
$TestResult=$LastExitCode
echo "Tests finished with code $TestResult"
echo "Uploading test results"
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path C:\projects\test_results.xml))
if ($TestResult -ne 0) {exit $TestResult}
artifacts:
- path: NppSaveAsAdmin_*.zip
name: release_package
- path: UnitTests/%CONFIGURATION%/UnitTests.exe
name: Unit test x86 binary
- path: UnitTests/x64/%CONFIGURATION%/UnitTests.exe
name: Unit test x64 binary
deploy:
provider: GitHub
auth_token:
secure: 6TQ/ECbh22HvTfxCyQQCE8j+Mlcu4qEapi5xOKto9YEYEf0Pf6daE3bmJ8DFFp2h
artifact: release_package
draft: false
prerelease: false
force_update: true
on:
appveyor_repo_tag: true
PlatformToolset: v141_xp
configuration: Release