@@ -50,11 +50,15 @@ dotnet_csproj:
5050  version : ' {version}' 
5151  assembly_version : ' {version}' 
5252
53+ #  set up the environment variables used later in the build process
54+ environment :
55+   installer_dir : Rubberduck.Deployment\InnoSetup\Installers\ 
56+   codecov_token :
57+     secure : WXzsqA7du+xTCQN0p06UFYOe94bKkB1ZtyCWS0Xlsu7OwIwKIa/OPaHj8Yev1JGl 
5358
5459before_build :
5560  - development/java/Rubberduck.Parsing/Grammar/gradlew.bat -p development/java/Rubberduck.Parsing/Grammar clean build 
5661  - cinst innosetup -version 5.6.1 
57-   - cinst codecov 
5862  - cinst opencover.portable 
5963  - nuget restore RubberduckMeta.sln 
6064  - nuget restore Rubberduck.sln 
@@ -66,14 +70,16 @@ build:
6670#  Otherwise we might run tests against artifacts that do not exist
6771test_script :
6872  #  we use -returntargetcode to fail the build if tests fail
69-   - cmd : OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml" 
70-   - cmd : OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml" 
7173  #  when using test_script, after_test seems to not be executed
72-   - cmd : codecov -f "Rubberduck_Coverage.xml RubberduckCodeAnalysis_Coverage.xml" 
74+   #  Manually select coverage instrumentation using "-register:Path64" to fix coverage generation
75+   #  Limit number of visits recorded with threshold to improve performance
76+   - | 
77+     OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -threshold:10 -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml" 
78+     OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -threshold:10 -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml" 
79+     curl --silent https://codecov.io/bash --output codecov 
80+     bash codecov -f Rubberduck_Coverage.xml -f RubberduckCodeAnalysis_Coverage.xml 
7381
7482#  Define the installer-name depending on what branch we're building on
75- environment :
76-   installer_dir : Rubberduck.Deployment\InnoSetup\Installers\ 
7783for :
7884- 
7985  branches :
@@ -116,6 +122,10 @@ artifacts:
116122    name : InspectionDocs 
117123  - path : Rubberduck.Deployment\InnoSetup\Installers\*.hash 
118124    name : InstallerHashes 
125+   - path : Rubberduck_Coverage.xml 
126+     name : MainCoverage 
127+   - path : RubberduckCodeAnalysis_Coverage.xml 
128+     name : AnalysisCoverage 
119129deploy :
120130  - provider : GitHub 
121131    tag : RETAGMEWITHAMESSAGE 
0 commit comments