Skip to content

Commit

Permalink
Merge pull request #5334 from Vogel612/fix/codecov-integration
Browse files Browse the repository at this point in the history
Fix codecov integration, Fixes #5332
  • Loading branch information
retailcoder authored Jan 5, 2020
2 parents fbcce0d + c0c0afc commit 52afae2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
22 changes: 16 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ dotnet_csproj:
version: '{version}'
assembly_version: '{version}'

# 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 5.6.1
- cinst codecov
- cinst opencover.portable
- nuget restore RubberduckMeta.sln
- nuget restore Rubberduck.sln
Expand All @@ -66,14 +70,16 @@ build:
# Otherwise we might run tests against artifacts that do not exist
test_script:
# we use -returntargetcode to fail the build if tests fail
- cmd: OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
- cmd: OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
# when using test_script, after_test seems to not be executed
- cmd: codecov -f "Rubberduck_Coverage.xml RubberduckCodeAnalysis_Coverage.xml"
# 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"
curl --silent https://codecov.io/bash --output codecov
bash codecov -f Rubberduck_Coverage.xml -f RubberduckCodeAnalysis_Coverage.xml
# Define the installer-name depending on what branch we're building on
environment:
installer_dir: Rubberduck.Deployment\InnoSetup\Installers\
for:
-
branches:
Expand Down Expand Up @@ -116,6 +122,10 @@ artifacts:
name: InspectionDocs
- 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
Expand Down
18 changes: 12 additions & 6 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
codecov:
branch: next
ci:
- appveyor
max_report_age: off

ignore:
Expand All @@ -19,8 +16,15 @@ coverage:
precision: 2
range: 40..80
status:
# don't check patch coverage
patch: off
# don't block mindlessly on coverage failures
informational: true
# status information for PRs only
only_pulls: true
patch:
default:
# strongly suggest more than 60% of changes be covered
target: 60
threshold: 10
project:
default:
target: 0 # don't force a minimum coverage
Expand All @@ -31,4 +35,6 @@ coverage:
comment:
layout: "flags, diff, files"
behavior: once
require_changes: yes
require_head: no
require_base: no

0 comments on commit 52afae2

Please sign in to comment.