Skip to content

Commit

Permalink
[Fix] Github Action Issues (#3759)
Browse files Browse the repository at this point in the history
* Fix Windows workflow action

* Changed dotnet test command

* fix some stuff

* Fix

* fix windows action

* Added `OverwriteReadOnlyFiles`

* revert some stuff

* update version for coverallsapp action

* fixes to tests

* Fixes

* fixed

* continue on error

* Update .github/workflows/main.yml

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

* fix

* revert to do what @shargon wants

* Upload

* Update .github/workflows/main.yml

* Fixed readonly

* ci fix

* added `--disable-parallel`

* fix `-p:Exclude="[Neo.UnitTests]*"`

---------

Co-authored-by: Shargon <[email protected]>
  • Loading branch information
cschuchardt88 and shargon authored Feb 15, 2025
1 parent b28f604 commit 251cb6d
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 60 deletions.
54 changes: 22 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

env:
DOTNET_VERSION: 9.0.x
COVERLET_EXCLUDE_COVERAGE: -p:Exclude="[Neo.UnitTests]*"

jobs:

Expand Down Expand Up @@ -39,7 +38,7 @@ jobs:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build (Everything)
run: dotnet build -p:GITHUB_ACTIONS=true
run: dotnet build --disable-parallel -p:GITHUB_ACTIONS=true

- name: Install dependencies
run: |
Expand Down Expand Up @@ -70,53 +69,44 @@ jobs:
run: |
brew install leveldb
brew install gperftools
dotnet build -p:GITHUB_ACTIONS=true
dotnet build --disable-parallel -p:GITHUB_ACTIONS=true
dotnet test --no-build -p:GITHUB_ACTIONS=true
- name: Test (windows)
if: matrix.os == 'windows-latest'
run: |
dotnet build -p:GITHUB_ACTIONS=true
dotnet build --disable-parallel -p:GITHUB_ACTIONS=true
dotnet test --no-build -p:GITHUB_ACTIONS=true
- name: Test for coverall
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get --assume-yes install libleveldb-dev librocksdb-dev
dotnet test ./tests/Neo.Cryptography.BLS12_381.Tests --output ./bin/tests/Neo.Cryptography.BLS12_381.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.ConsoleService.Tests --output ./bin/tests/Neo.ConsoleService.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.UnitTests --output ./bin/tests/Neo.UnitTests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.VM.Tests --output ./bin/tests/Neo.VM.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Json.UnitTests --output ./bin/tests/Neo.Json.UnitTests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Extensions.Tests --output ./bin/tests/Neo.Extensions.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
# Plugins
dotnet test ./tests/Neo.Cryptography.MPTTrie.Tests --output ./bin/tests/Neo.Cryptography.MPTTrie.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Network.RPC.Tests --output ./bin/tests/Neo.Network.RPC.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Plugins.OracleService.Tests --output ./bin/tests/Neo.Plugins.OracleService.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Plugins.RpcServer.Tests --output ./bin/tests/Neo.Plugins.RpcServer.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Plugins.Storage.Tests --output ./bin/tests/Neo.Plugins.Storage.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet test ./tests/Neo.Plugins.ApplicationLogs.Tests --output ./bin/tests/Neo.Plugins.ApplicationLogs.Tests ${{ env.COVERLET_EXCLUDE_COVERAGE }} -p:GITHUB_ACTIONS=true
dotnet build --disable-parallel -p:GITHUB_ACTIONS=true
dotnet test --no-build -p:GITHUB_ACTIONS=true -p:Exclude="[Neo.UnitTests]*"
- name: Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/[email protected].0
uses: coverallsapp/[email protected].6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
debug: false
measure: true
allow-empty: true
format: lcov
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
${{ github.workspace }}/tests/Neo.Plugins.ApplicationLogs.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/Neo.Extensions.Tests/TestResults/coverage.info
${{ github.workspace }}/TestResults/Neo.UnitTests/coverage.info
${{ github.workspace }}/TestResults/Neo.Cryptography.BLS12_381.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.ConsoleService.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.VM.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Json.UnitTests/coverage.info
${{ github.workspace }}/TestResults/Neo.Cryptography.MPTTrie.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Network.RPC.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Plugins.OracleService.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Plugins.RpcServer.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Plugins.Storage.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Plugins.ApplicationLogs.Tests/coverage.info
${{ github.workspace }}/TestResults/Neo.Extensions.Tests/coverage.info

PublishPackage:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'neo-project/')
Expand Down
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<WarningLevel>4</WarningLevel>
<AnalysisLevel>latest</AnalysisLevel>
<OutputPath>../../bin/$(PackageId)</OutputPath>
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion src/Plugins/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<Import Project="../$(MSBuildThisFile)" />

<PropertyGroup>
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../../Neo/Neo.csproj" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/LevelDBStore/LevelDBStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</PropertyGroup>

<Target Name="DownloadNativeLibs" BeforeTargets="PreBuildEvent">
<DownloadFile Condition="!Exists('runtimes/%(NativeLib.RuntimeId)/native/%(NativeLib.Lib)')" SourceUrl="https://github.com/neo-ngd/leveldb/releases/download/v1.23/libleveldb-%(NativeLib.RuntimeId).zip" DestinationFolder="$(BaseIntermediateOutputPath)" />
<Unzip Condition="Exists('$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId).zip') And !Exists('runtimes/%(NativeLib.RuntimeId)/native/%(NativeLib.Lib)')" SourceFiles="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId).zip" DestinationFolder="$(BaseIntermediateOutputPath)" />
<Move SourceFiles="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId)/%(NativeLib.Lib)" DestinationFolder="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId)/runtimes/%(NativeLib.RuntimeId)/native/" />
<DownloadFile Condition="!Exists('runtimes/%(NativeLib.RuntimeId)/native/%(NativeLib.Lib)')" SourceUrl="https://github.com/neo-ngd/leveldb/releases/download/v1.23/libleveldb-%(NativeLib.RuntimeId).zip" DestinationFolder="$(BaseIntermediateOutputPath)" Retries="3" />
<Unzip Condition="Exists('$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId).zip') And !Exists('runtimes/%(NativeLib.RuntimeId)/native/%(NativeLib.Lib)')" SourceFiles="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId).zip" DestinationFolder="$(BaseIntermediateOutputPath)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" />
<Move SourceFiles="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId)/%(NativeLib.Lib)" DestinationFolder="$(BaseIntermediateOutputPath)libleveldb-%(NativeLib.RuntimeId)/runtimes/%(NativeLib.RuntimeId)/native/" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" />
</Target>

<ItemGroup>
Expand Down
13 changes: 7 additions & 6 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<CollectCoverage>true</CollectCoverage>
<CoverletOutput>TestResults/</CoverletOutput>
<CoverletOutput>../../TestResults/$(MSBuildProjectName)/</CoverletOutput>
<CoverletOutputFormat>lcov</CoverletOutputFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<AnalysisLevel>latest</AnalysisLevel>
<OutputPath>../../bin/tests/$(MSBuildProjectName)</OutputPath>
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="coverlet.collector" Version="6.0.4" >
<IncludeAssets>all</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<IncludeAssets>all</IncludeAssets>
</PackageReference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>neo_cli.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Cryptography.MPT.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions tests/Neo.Network.RPC.Tests/Neo.Network.RPC.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Network.RPC.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Plugins.ApplicationsLogs.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<PackageId>OracleService.Tests</PackageId>
<RootNamespace>Neo.Plugins</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Plugins.RpcServer.Tests</RootNamespace>
<AssemblyName>Neo.Plugins.RpcServer.Tests</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Plugins.Storage.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions tests/Neo.VM.Tests/Neo.VM.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Test</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down

0 comments on commit 251cb6d

Please sign in to comment.