-
Notifications
You must be signed in to change notification settings - Fork 301
/
appveyor.yml
170 lines (151 loc) · 6.98 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
version: '2.5.9.{build}'
# enforce crlf fixing
init:
- git config --global core.autocrlf true
# history limited to 15 commits, since we ran into trouble with a limit of 3
# the limit can be rather generous
clone_depth: 15
# explicitly do not shallow-clone.
# Line-Endings are wrong on github, because of CRLF fixing
# shallow-clone would download a zip, which doesn't fix the line-endings for unit-tests
shallow_clone: false
# ignore a certain subset of files when evaluating build-changes
skip_commits:
files:
- docs/*
- '**/*.md'
- license
- License.rtf
branches:
only:
- main
- next
skip_tags: true
# build-matrix: all Release CPUs on Visual Studio
image: Visual Studio 2022
configuration: Release
platform: Any CPU
# cache the nuget packages unless something changed there
cache:
- packages/ -> **/packages.config
- '%USERPROFILE%/.gradle/wrapper/dists'
install:
- set PATH=C:\Program Files (x86)\MSBuild\15.0\Bin;C:\Program Files (x86)\Java\jdk1.8.0;%PATH%
# set up the environment variables used later in the build process
environment:
installer_dir: Rubberduck.Deployment\InnoSetup\Installers\
codecov_token:
secure: WXzsqA7du+xTCQN0p06UFYOe94bKkB1ZtyCWS0Xlsu7OwIwKIa/OPaHj8Yev1JGl
before_build:
- development/java/Rubberduck.Parsing/Grammar/gradlew.bat -p development/java/Rubberduck.Parsing/Grammar clean build
- cinst innosetup --version 6.0.5
# - cinst codecov
# - cinst gnupg
- cinst opencover.portable
- nuget restore RubberduckMeta.sln
- nuget restore Rubberduck.sln
build_script:
- ps: msbuild "C:\projects\rubberduck\Rubberduck.sln" -property:"Version=$env:APPVEYOR_BUILD_VERSION" -verbosity:minimal -logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# TestScript depends on the build matrix to only contain Release cpu
# Otherwise we might run tests against artifacts that do not exist
test_script:
# we use -returntargetcode to fail the build if tests fail
# when using test_script, after_test seems to not be executed
# Manually select coverage instrumentation using "-register:Path64" to fix coverage generation
# Limit number of visits recorded with threshold to improve performance
- |
OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -threshold:10 -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -threshold:10 -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
on_success:
- ps: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
./codecov.exe -f 'Rubberduck_Coverage.xml' -X search
./codecov.exe -f 'RubberduckCodeAnalysis_Coverage.xml' -X search
# choco install gnupg --no-progress --limit-output --confirm --execution-timeout=60
# Invoke-WebRequest -Uri https://keybase.io/codecovsecurity/pgp_keys.asc -OutFile codecov.asc
# gpg.exe --import codecov.asc
# Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM -Outfile codecov.exe.SHA256SUM
# Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM.sig -Outfile codecov.exe.SHA256SUM.sig
# gpg.exe --verify codecov.exe.SHA256SUM.sig codecov.exe.SHA256SUM
# If ($(Compare-Object -ReferenceObject $(($(certUtil -hashfile codecov.exe SHA256)[1], "codecov.exe") -join " ") -DifferenceObject $(Get-Content codecov.exe.SHA256SUM)).length -eq 0) { echo "SHASUM verified" } Else {exit 1}
# codecov -f "Rubberduck_Coverage.xml" -n "Main Project Coverage" --flag unit
# codecov -f "RubberduckCodeAnalysis_Coverage.xml" -n "Meta Coverage" --flag meta
# Define the installer-name depending on what branch we're building on
for:
-
branches:
only:
- next
environment:
installer_name: Rubberduck.Setup.%APPVEYOR_BUILD_VERSION%-pre.exe
release_name: Rubberduck v%APPVEYOR_BUILD_VERSION%-pre
-
branches:
only:
- main
environment:
installer_name: Rubberduck.Setup.%APPVEYOR_BUILD_VERSION%.exe
release_name: Rubberduck v%APPVEYOR_BUILD_VERSION%
-
branches:
except:
- main
- next
environment:
# fall back to naming the installer something that shows we're in an unexpected state
installer_name: Rubberduck.Setup.%APPVEYOR_BUILD_VERSION%-unexpected.exe
release_name: Rubberduck v%APPVEYOR_BUILD_VERSION%-%APPVEYOR_REPO_BRANCH%
# Create Installers to store at appveyor and upload to github
after_test:
- cmd: '"C:\Program Files (x86)\Inno Setup 6\iscc.exe" /O "Rubberduck.Deployment\InnoSetup\Rubberduck.Installer.Build.iss"'
- cmd: move %INSTALLER_DIR%\Rubberduck.Setup.exe %INSTALLER_DIR%\%INSTALLER_NAME%
- ps: |
$installer = "$env:INSTALLER_DIR\$env:INSTALLER_NAME"
$sha = Get-FileHash -Path $installer -Algorithm SHA256
Set-Content -Path "$($installer)_sha256.hash" -Value $sha.Hash
# grab the installers we produce and upload them to github :)
artifacts:
- path: Rubberduck.Deployment\InnoSetup\Installers\Rubberduck.Setup.*.exe
name: Rubberduck
- path: Rubberduck.Deployment\bin\Rubberduck.CodeAnalysis.xml
name: InspectionDocs
- path: Rubberduck.Deployment\bin\Rubberduck.Parsing.xml
name: AnnotationDocs
- path: Rubberduck.Deployment\InnoSetup\Installers\*.hash
name: InstallerHashes
- path: Rubberduck_Coverage.xml
name: MainCoverage
- path: RubberduckCodeAnalysis_Coverage.xml
name: AnalysisCoverage
deploy:
- provider: GitHub
tag: RETAGMEWITHAMESSAGE
release: $(release_name)
draft: true
prerelease: false
description: "Built with :heart: by AppVeyor CI on [$(appveyor_repo_branch)] - $(appveyor_url)/project/$(appveyor_account_name)/$(appveyor_project_slug)/build/$(appveyor_build_version)"
auth_token:
secure: 2+FXBVrkpeLgfucr22+zqboZ4N/SXM+nCKrmCSzFS3VrUVRevSK4ZUYqQvOr1VmZ
artifact: Rubberduck, InspectionDocs, AnnotationDocs, InstallerHashes
on:
branch: main
- provider: GitHub
tag: Prerelease-v$(appveyor_build_version)
release: $(release_name)
draft: false
prerelease: true
description: "AppVeyor build on [$(appveyor_repo_branch)] - $(appveyor_url)/project/$(appveyor_account_name)/$(appveyor_project_slug)/build/$(appveyor_build_version)"
auth_token:
secure: 2+FXBVrkpeLgfucr22+zqboZ4N/SXM+nCKrmCSzFS3VrUVRevSK4ZUYqQvOr1VmZ
artifact: Rubberduck, InspectionDocs, AnnotationDocs, InstallerHashes
on:
branch: next
notifications:
- provider: GitHubPullRequest
auth_token:
secure: 2+FXBVrkpeLgfucr22+zqboZ4N/SXM+nCKrmCSzFS3VrUVRevSK4ZUYqQvOr1VmZ
template: "{{#passed}}:white_check_mark:{{/passed}}{{#failed}}:x:{{/failed}} [Build {{&projectName}} {{buildVersion}} {{status}}]({{buildUrl}}) (commit {{commitUrl}} by @{{&commitAuthorUsername}})"
on_build_success: true
on_build_failure: true
on_build_status_changed: true