Skip to content

Commit

Permalink
Merge pull request #16 from DafnyVSCode/improvement/code-coverage
Browse files Browse the repository at this point in the history
Add code coverage reports to builds.
  • Loading branch information
camrein authored Nov 11, 2020
2 parents bf22e1d + fd4a51e commit 1954fa1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ jobs:
suffix: ubuntu-16.04
z3: z3-4.8.4.d6df51951f4c-x64-ubuntu-16.04
chmod: true
coverage: true
- os: windows-2019
suffix: win
z3: z3-4.8.4.d6df51951f4c-x64-win
chmod: false
coverage: false
- os: macos-10.15
suffix: osx-10.14.1
z3: z3-4.8.4.d6df51951f4c-x64-osx-10.14.1
chmod: true
coverage: false
env:
binaryPath: DafnyLS/bin/Release/netcoreapp3.1
testPath: DafnyLS.IntegrationTest/bin/Debug/netcoreapp3.1
z3BaseUri: https://github.com/Z3Prover/z3/releases/download/z3-4.8.4
coverageFile: coverage.cobertura.xml
outputs:
binaries: ${{env.binaryPath}}
steps:
Expand All @@ -55,7 +59,19 @@ jobs:
if: ${{matrix.chmod}}
run: chmod +x ${{env.testPath}}/z3/bin/z3
- name: Run Tests
if: ${{!matrix.coverage}}
run: dotnet test --no-restore --verbosity normal
- name: Run Test Coverage
if: ${{matrix.coverage}}
run: |
dotnet test --no-restore --verbosity normal --settings DafnyLS.IntegrationTest/coverlet.runsettings
mv DafnyLS.IntegrationTest/TestResults/*/${{env.coverageFile}} ./${{env.coverageFile}}
ls -al .
- name: Upload Coverage Report
if: ${{matrix.coverage}}
uses: codecov/codecov-action@v1
with:
file: ./Source/${{env.coverageFile}}
- name: Upload Artifacts
if: ${{github.ref == 'master'}}
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ bin/
obj/
.vs/
*.user

TestResults/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# DafnyLS

[![.NET Core](https://github.com/DafnyVSCode/language-server-csharp/workflows/.NET%20Core/badge.svg)](https://github.com/DafnyVSCode/language-server-csharp/actions?query=workflow%3A%22.NET+Core%22)
[![Code coverage](https://codecov.io/github/DafnyVSCode/language-server-csharp/branch/master/graph/badge.svg)](https://codecov.io/github/DafnyVSCode/language-server-csharp/branch/master)

*DafnyLS* is a [language server](https://microsoft.github.io/language-server-protocol/) for [Dafny](https://github.com/dafny-lang/dafny). It is implemented in C# on .NET Core 3.1 with OmniSharp's [C# Language Server Protocol](https://github.com/OmniSharp/csharp-language-server-protocol).

## Building
Expand Down
12 changes: 12 additions & 0 deletions Source/DafnyLS.IntegrationTest/coverlet.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat Code Coverage">
<Configuration>
<Include>[*]Microsoft.Dafny.LanguageServer.*</Include>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>

0 comments on commit 1954fa1

Please sign in to comment.