diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f79f8f352..10da41fa0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,9 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Check format + run: | + dotnet format --no-restore --verify-no-changes --verbosity diagnostic - name: Build Neo.Compiler.CSharp run: dotnet build ./src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj - name: Build Neo.SmartContract.Template and generate artifacts @@ -35,9 +38,6 @@ jobs: dotnet ./src/Neo.Compiler.CSharp/bin/Debug/net7.0/nccs.dll ./src/Neo.SmartContract.Template/bin/Debug/Nep17Contract.csproj -o ./tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/Artifacts/ --generate-artifacts source --debug - name: Build Solution run: dotnet build ./neo-devpack-dotnet.sln - - name: Check format - run: | - dotnet format --no-restore --verify-no-changes --verbosity diagnostic - name: Add package coverlet.msbuild run: find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild - name: Test Neo.Compiler.CSharp.UnitTests @@ -45,17 +45,17 @@ jobs: dotnet test ./tests/Neo.Compiler.CSharp.UnitTests \ --no-build \ -p:CollectCoverage=true \ - -p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/ + -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]*\" - name: Test Neo.SmartContract.Framework.UnitTests run: | dotnet test ./tests/Neo.SmartContract.Framework.UnitTests \ --no-build \ -l "console;verbosity=normal" \ -p:CollectCoverage=true \ - -p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov \ - -p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json \ - -p:Exclude=\"[Neo.Compiler.CSharp.UnitTests]*\" \ - -p:CoverletOutputFormat=lcov + -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]*\" - name: Test Neo.SmartContract.Template.UnitTests run: | dotnet test ./tests/Neo.SmartContract.Template.UnitTests \ @@ -63,13 +63,15 @@ jobs: -l "console;verbosity=detailed" \ -p:CollectCoverage=true \ -p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov \ - -p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json \ - -p:Exclude=\"[Neo.Compiler.CSharp.UnitTests]*\" \ + -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@master + uses: coverallsapp/github-action@v2.2.3 with: github-token: ${{ secrets.GITHUB_TOKEN }} + format: lcov + file: ${GITHUB_WORKSPACE}/coverage/lcov.info PublishPackage: if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')