diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index a1845219e2e..07406cefcd2 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -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: @@ -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 diff --git a/.gitignore b/.gitignore index 4b41211ec1c..e0cab91e34b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ bin/ obj/ .vs/ *.user - +TestResults/ diff --git a/README.md b/README.md index 111f5e384da..9b35768311a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Source/DafnyLS.IntegrationTest/coverlet.runsettings b/Source/DafnyLS.IntegrationTest/coverlet.runsettings new file mode 100644 index 00000000000..65bbc8bd231 --- /dev/null +++ b/Source/DafnyLS.IntegrationTest/coverlet.runsettings @@ -0,0 +1,12 @@ + + + + + + + [*]Microsoft.Dafny.LanguageServer.* + + + + +