This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate neo-modules Compilation with Local neo | |
on: [push, pull_request] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout neo | |
uses: actions/checkout@v2 | |
with: | |
path: ./neo | |
- name: Checkout neo-modules | |
uses: actions/checkout@v2 | |
with: | |
repository: neo-project/neo-modules | |
path: ./neo-modules | |
- name: Patch neo-modules Directory.Build.props to use local neo | |
run: | | |
props_path="./neo-modules/src/Directory.Build.props" | |
sed -i '/<PackageReference Include="Neo"/d' $props_path | |
sed -i '/<\/ItemGroup>/i \ <ProjectReference Include="../../../neo/src/Neo/Neo.csproj" />' $props_path | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.x' | |
- name: Clean neo-modules | |
run: | | |
cd neo-modules/ | |
dotnet clean | |
- name: Remove problematic file if it exists | |
run: | | |
FILE_PATH="./neo/src/Neo.Json/bin/Debug/net7.0/Neo.Json.deps.json" | |
if [ -f "$FILE_PATH" ]; then | |
rm $FILE_PATH | |
fi | |
- name: Introduce a short delay | |
run: sleep 10 | |
- name: Restore and build neo-modules | |
run: | | |
cd neo-modules/ | |
dotnet restore | |
dotnet build -v detailed | |
- name: Test neo-modules | |
run: | | |
sudo apt-get --assume-yes install libleveldb-dev libsnappy-dev libc6-dev | |
find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild | |
dotnet test tests/Neo.Network.RPC.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/ | |
dotnet test tests/Neo.Plugins.RpcServer.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json /p:CoverletOutputFormat=lcov | |
dotnet test tests/Neo.Plugins.Storage.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json /p:CoverletOutputFormat=lcov | |
dotnet test tests/Neo.Cryptography.MPTTrie.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json /p:CoverletOutputFormat=lcov | |
dotnet test tests/Neo.Plugins.OracleService.Tests /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov /p:MergeWith=${GITHUB_WORKSPACE}/coverage/coverage.json /p:CoverletOutputFormat=lcov |