Skip to content

Commit

Permalink
Fix coverage (#3155)
Browse files Browse the repository at this point in the history
* Update main.yml

* Update main.yml

* Update main.yml

* Change format

* Update .github/workflows/main.yml

* Update main.yml

* Update .github/workflows/main.yml

* Update main.yml

* Update .github/workflows/main.yml

* Update main.yml

* Update .github/workflows/main.yml

* Update .github/workflows/main.yml

* Avoid add package in other os

* Update main.yml

* Update main.yml

* Final fix

* Update .github/workflows/main.yml

* Update main.yml

* Update main.yml

* Update .github/workflows/main.yml

* Update .github/workflows/main.yml

* Remove rm

In windows fail

---------

Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
  • Loading branch information
shargon and vncoelho authored Feb 23, 2024
1 parent d8af2c6 commit de39a36
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,24 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
dotnet format --verify-no-changes --verbosity diagnostic
- name: Test
- name: Prepare coverage
if: matrix.os == 'ubuntu-latest'
run: |
find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov
- name: Test
run: |
dotnet test ./tests/Neo.ConsoleService.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/
dotnet test ./tests/Neo.Cryptography.BLS12_381.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.net7.0.json
dotnet test ./tests/Neo.UnitTests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.net7.0.json
dotnet test ./tests/Neo.VM.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.net7.0.json
dotnet test ./tests/Neo.Json.UnitTests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.net7.0.json /p:CoverletOutputFormat=lcov
- name: Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.net7.0.info
format: lcov
file: ${GITHUB_WORKSPACE}/coverage/lcov.net7.0.info

PublishPackage:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
Expand Down

0 comments on commit de39a36

Please sign in to comment.