Skip to content

Commit

Permalink
Fix Code Coverage (#7)
Browse files Browse the repository at this point in the history
* Save coverage report as artifact

* Try using ./

* Try fixing codecov

* Put fixes in the right place

* Try using cobertura

* Try using coveralls

* Only run on pull request
  • Loading branch information
withinboredom authored Nov 24, 2019
1 parent abe2a7d commit 2760d74
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
codecov:
require_ci_to_pass: no

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no
fixes:
- "/home/runner/work/system-76-keyboards/system-76-keyboards/::"


comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Builder

on: [push]
on: [pull_request]

jobs:
tests:
Expand All @@ -18,10 +18,14 @@ jobs:
run: dotnet test --settings coverletArgs.runsettings
- name: Stage code coverage
working-directory: csharp
run: mv UnitTests/TestResults/*/coverage.opencover.xml .
run: mv UnitTests/TestResults/*/coverage.info .
- name: Save coverage as artifact
uses: actions/upload-artifact@v1
with:
name: coverage-report
path: csharp/coverage.info
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: coverallsapp/github-action@master
with:
token: ${{ secrets.CODECOV }}
file: csharp/coverage.opencover.xml
name: Coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./csharp/coverage.info
2 changes: 1 addition & 1 deletion csharp/coverletArgs.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Output>results</Output>
<Format>xml,opencover</Format>
<Format>lcov</Format>
<Exclude>[UnitTests]*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
<SingleHit>false</SingleHit>
Expand Down

0 comments on commit 2760d74

Please sign in to comment.