Skip to content

Commit

Permalink
Coveralls and packages update (#1046)
Browse files Browse the repository at this point in the history
* Coveralls update

* Consolidate nugets

* Exclude coverage in env variable

* fix args

* Minor env vars

* Try to fix some extra parameters

* Update .github/workflows/main.yml

* Adjust exclude variable

* space

* try with aspas

* Try with double aspas

* simplify

* Simplify all env

---------

Co-authored-by: Jimmy <jimmy@r3e.network>
Co-authored-by: Vitor Nazario Coelho <vncoelho@gmail.com>
  • Loading branch information
3 people committed May 22, 2024
1 parent 0cffc97 commit 654760f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
44 changes: 19 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

env:
DOTNET_VERSION: 8.0.x
DOTNET_TEST_PARAMETERS: --no-build /p:CollectCoverage=true -l "console;verbosity=detailed"
COVERLET_EXCLUDE_COVERAGE: /p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
COVERLET_OUTPUT: /p:CoverletOutput=${{ github.workspace }}/coverage-join/
COVERLET_MERGE_WITH: /p:MergeWith=${{ github.workspace }}/coverage-join/coverage.json

jobs:

Expand Down Expand Up @@ -51,43 +55,33 @@ jobs:
- name: Test Neo.Compiler.CSharp.UnitTests
run: |
dotnet test ./tests/Neo.Compiler.CSharp.UnitTests \
--no-build \
/p:CollectCoverage=true \
/p:CoverletOutput=${{ github.workspace }}/coverage-join/ \
/p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Framework.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Framework.UnitTests \
--no-build \
-e "COVERAGE_MERGE_JOIN=${{ github.workspace }}/coverage-join/coverage.json" \
-l "console;verbosity=detailed" \
/p:CollectCoverage=true \
/p:CoverletOutput=${{ github.workspace }}/coverage-join/ \
/p:MergeWith=${{ github.workspace }}/coverage-join/coverage.json \
/p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Testing.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Testing.UnitTests \
--no-build \
-e "COVERAGE_MERGE_JOIN=${{ github.workspace }}/coverage-join/coverage.json" \
-l "console;verbosity=detailed" \
/p:CollectCoverage=true \
/p:CoverletOutput=${{ github.workspace }}/coverage-join/ \
/p:MergeWith=${{ github.workspace }}/coverage-join/coverage.json \
/p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\"
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_OUTPUT }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
- name: Test Neo.SmartContract.Template.UnitTests
run: |
dotnet test ./tests/Neo.SmartContract.Template.UnitTests \
--no-build \
-e "COVERAGE_MERGE_JOIN=${{ github.workspace }}/coverage-join/coverage.json" \
-l "console;verbosity=detailed" \
/p:CollectCoverage=true \
${{ env.DOTNET_TEST_PARAMETERS }} \
${{ env.COVERLET_MERGE_WITH }} \
${{ env.COVERLET_EXCLUDE_COVERAGE }} \
/p:CoverletOutput=${{ github.workspace }}/coverage/lcov \
/p:MergeWith=${{ github.workspace }}/coverage-join/coverage.json \
/p:Exclude=\"[Neo.SmartContract.TestEngine]*,[Neo.Compiler.CSharp.UnitTests]*,[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*\" \
/p:CoverletOutputFormat=lcov
- name: Coveralls
uses: coverallsapp/github-action@v2.2.3
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: lcov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<ItemGroup>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="ReportGenerator.Core" Version="5.2.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Include="ReportGenerator.Core" Version="5.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 654760f

Please sign in to comment.