Skip to content

Commit

Permalink
Merge branch 'master' into fix-3296
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y committed Jun 7, 2024
2 parents dc0b574 + 6e8c730 commit 612497a
Show file tree
Hide file tree
Showing 25 changed files with 127 additions and 79 deletions.
69 changes: 44 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@ on:

env:
DOTNET_VERSION: 8.0.x
COVERALL_COLLECT_OUTPUT: "/p:CollectCoverage=true /p:CoverletOutput='${{ github.workspace }}/TestResults/coverage/'"
COVERALL_MERGE_PATH: "/p:MergeWith='${{ github.workspace }}/TestResults/coverage/coverage.json'"

jobs:

Format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Check Format (*.cs)
run: dotnet format --verify-no-changes --verbosity diagnostic

- name: Build (Neo.CLI)
run: |
dotnet build ./src/Neo.CLI \
--output ./out/Neo.CLI
Test:
needs: [Format]
timeout-minutes: 15
strategy:
matrix:
Expand All @@ -25,14 +43,6 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check format
if: matrix.os == 'ubuntu-latest'
run: |
dotnet format --verify-no-changes --verbosity diagnostic
- name: Build CLI
if: matrix.os == 'ubuntu-latest'
run: |
dotnet publish ./src/Neo.CLI
- name: Test
if: matrix.os != 'ubuntu-latest'
run: |
Expand All @@ -42,31 +52,40 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get --assume-yes install libleveldb-dev librocksdb-dev
dotnet test ./tests/Neo.Cryptography.BLS12_381.Tests ${{ env.COVERALL_COLLECT_OUTPUT }}
dotnet test ./tests/Neo.ConsoleService.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.UnitTests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.VM.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Json.UnitTests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Cryptography.BLS12_381.Tests --output ./bin/tests/Neo.Cryptography.BLS12_381.Tests
dotnet test ./tests/Neo.ConsoleService.Tests --output ./bin/tests/Neo.ConsoleService.Tests
dotnet test ./tests/Neo.UnitTests --output ./bin/tests/Neo.UnitTests
dotnet test ./tests/Neo.VM.Tests --output ./bin/tests/Neo.VM.Tests
dotnet test ./tests/Neo.Json.UnitTests --output ./bin/tests/Neo.Json.UnitTests
# Plugins
dotnet test ./tests/Neo.Cryptography.MPTTrie.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Network.RPC.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Plugins.OracleService.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Plugins.RpcServer.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }}
dotnet test ./tests/Neo.Plugins.Storage.Tests ${{ env.COVERALL_COLLECT_OUTPUT }} ${{ env.COVERALL_MERGE_PATH }} /p:CoverletOutputFormat='cobertura'
dotnet test ./tests/Neo.Cryptography.MPTTrie.Tests --output ./bin/tests/Neo.Cryptography.MPTTrie.Tests
dotnet test ./tests/Neo.Network.RPC.Tests --output ./bin/tests/Neo.Network.RPC.Tests
dotnet test ./tests/Neo.Plugins.OracleService.Tests --output ./bin/tests/Neo.Plugins.OracleService.Tests
dotnet test ./tests/Neo.Plugins.RpcServer.Tests --output ./bin/tests/Neo.Plugins.RpcServer.Tests
dotnet test ./tests/Neo.Plugins.Storage.Tests --output ./bin/tests/Neo.Plugins.Storage.Tests
- name: Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: cobertura
file: ${{ github.workspace }}/TestResults/coverage/coverage.cobertura.xml
files:
${{ github.workspace }}/tests/Neo.Cryptography.BLS12_381.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.ConsoleService.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.UnitTests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.VM.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Json.UnitTests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Cryptography.MPTTrie.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Network.RPC.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Plugins.OracleService.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Plugins.RpcServer.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Plugins.Storage.Tests/TestResults/coverage.info

PublishPackage:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
needs: [Test]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -115,7 +134,7 @@ jobs:
Release:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
needs: Test
needs: [Test]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions src/Neo.CLI/Neo.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Product>Neo.CLI</Product>
<ApplicationIcon>neo.ico</ApplicationIcon>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)/bin/$(AssemblyTitle)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Neo.ConsoleService/Neo.ConsoleService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<PackageId>Neo.ConsoleService</PackageId>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Neo.Cryptography.BLS12_381</PackageId>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Neo.Extensions/Neo.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<PackageId>Neo.Extensions</PackageId>
<PackageTags>NEO;Blockchain;Extensions</PackageTags>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Neo.GUI/Neo.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<Product>Neo.GUI</Product>
<ApplicationIcon>neo.ico</ApplicationIcon>
<GenerateResourceWarnOnBinaryFormatterUse>false</GenerateResourceWarnOnBinaryFormatterUse>
<BaseOutputPath>$(SolutionDir)/bin/$(AssemblyTitle)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -62,4 +63,4 @@
<ReferenceSourceTarget></ReferenceSourceTarget>
</ProjectReference>
</ItemGroup>
</Project>
</Project>
2 changes: 2 additions & 0 deletions src/Neo.IO/Neo.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<PackageId>Neo.IO</PackageId>
<PackageTags>NEO;Blockchain;IO</PackageTags>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Neo.Json/Neo.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Neo.Json</PackageId>
<PackageTags>NEO;JSON</PackageTags>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Neo.VM/Neo.VM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<PackageId>Neo.VM</PackageId>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Neo/Neo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageId>Neo</PackageId>
<PackageTags>NEO;AntShares;Blockchain;Smart Contract</PackageTags>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 612497a

Please sign in to comment.