Skip to content

Commit

Permalink
Fixed up main.yml (#3292)
Browse files Browse the repository at this point in the history
* Added `BaseOutputPath`

* Remove binaries

* Fixed Build

* Changed output directory `github` actions

* Fixed tests

* Fixed bug with `output`

* Added `test` soltion file

* Remove output for mac and windows

* Fixed Coveralls

* Fixed Coveralls `path`

* Revert "Fixed Coveralls `path`"

This reverts commit 5ba38b1.

* Fixed up coverall

* Fixed `mergewith`

* Fixed pathing

* fixed `ls` command

* Fixed all paths for tests

* Added new steps and jobs

* Move a command

* Added new path for `coverage.cobertura.xml` report

* Changed `Coveralls` report path

* Fixed pathing for `TestResults`

* Fixed Report location

* Fixed Report location

* Fixed file extensions

* Fixed `MergeWith` path

* Added list directory

* Changed format coverage.lcov

* Added all files

* Fixed location

* Fixed path for lcov

* Fixed file extension

* Added `${{ github.workspace }}/`

* Fixed path

* sfs

* Fixed files argument

* Fixed files

* Fixed `Neo.Json.UnitTests` path

* Fixed `Neo.Json.UnitTests` test output path

* Update .github/workflows/main.yml

Co-authored-by: Shargon <[email protected]>

---------

Co-authored-by: Jimmy <[email protected]>
Co-authored-by: Shargon <[email protected]>
  • Loading branch information
3 people committed Jun 7, 2024
1 parent 766ad08 commit 6e8c730
Show file tree
Hide file tree
Showing 24 changed files with 82 additions and 33 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
3 changes: 2 additions & 1 deletion src/Plugins/ApplicationLogs/ApplicationLogs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PackageId>Neo.Plugins.ApplicationLogs</PackageId>
<RootNamespace>Neo.Plugins</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,4 +19,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions src/Plugins/DBFTPlugin/DBFTPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>Neo.Consensus.DBFT</PackageId>
<RootNamespace>Neo.Consensus</RootNamespace>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Neo\Neo.csproj" />
<ProjectReference Include="../../Neo/Neo.csproj" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Plugins/LevelDBStore/LevelDBStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PackageId>Neo.Plugins.Storage.LevelDBStore</PackageId>
<RootNamespace>Neo.Plugins.Storage</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions src/Plugins/MPTTrie/MPTTrie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PackageId>Neo.Cryptography.MPT</PackageId>
<RootNamespace>Neo.Cryptography</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

</Project>
3 changes: 2 additions & 1 deletion src/Plugins/OracleService/OracleService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>Neo.Plugins.OracleService</PackageId>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,4 +24,4 @@
</None>
</ItemGroup>

</Project>
</Project>
1 change: 1 addition & 0 deletions src/Plugins/RocksDBStore/RocksDBStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>Neo.Plugins.Storage.RocksDBStore</PackageId>
<RootNamespace>Neo.Plugins.Storage</RootNamespace>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

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

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Plugins/RpcServer/RpcServer.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>Neo.Plugins.RpcServer</PackageId>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Plugins/SQLiteWallet/SQLiteWallet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<RootNamespace>Neo.Wallets.SQLite</RootNamespace>
<PackageId>Neo.Wallets.SQLite</PackageId>
<ImplicitUsings>enable</ImplicitUsings>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Plugins/StateService/StateService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>Neo.Plugins.StateService</PackageId>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,4 +19,4 @@
</None>
</ItemGroup>

</Project>
</Project>
1 change: 1 addition & 0 deletions src/Plugins/StorageDumper/StorageDumper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PackageId>Neo.Plugins.StorageDumper</PackageId>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/Plugins/TokensTracker/TokensTracker.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<PackageId>Neo.Plugins.TokensTracker</PackageId>
<BaseOutputPath>$(SolutionDir)/bin/$(PackageId)</BaseOutputPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +16,4 @@
</None>
</ItemGroup>

</Project>
</Project>
3 changes: 3 additions & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<WarningLevel>0</WarningLevel>
<CollectCoverage>true</CollectCoverage>
<CoverletOutput>TestResults/</CoverletOutput>
<CoverletOutputFormat>lcov</CoverletOutputFormat>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6e8c730

Please sign in to comment.