From 1f779fec252aa5bb4b59f26a050e49b5c6e0d50f Mon Sep 17 00:00:00 2001 From: Jinghui Liao Date: Fri, 13 Oct 2023 02:11:30 +0800 Subject: [PATCH] add test to the projects that rely on neo-core --- .github/workflows/test_cli.yml | 40 +++++++++++++++++++++++++ .github/workflows/test_devpack.yml | 43 ++++++++++++++++++++++++++ .github/workflows/test_plugins.yml | 48 ++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 .github/workflows/test_cli.yml create mode 100644 .github/workflows/test_devpack.yml create mode 100644 .github/workflows/test_plugins.yml diff --git a/.github/workflows/test_cli.yml b/.github/workflows/test_cli.yml new file mode 100644 index 0000000000..9cea20357e --- /dev/null +++ b/.github/workflows/test_cli.yml @@ -0,0 +1,40 @@ +name: Validate neo-node 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-node + uses: actions/checkout@v2 + with: + repository: neo-project/neo-node + path: ./neo-node + + - name: Patch neo-node neo-cli.csproj to use local neo + run: | + # Path to neo-cli.csproj in neo-node + csproj_path="./neo-node/neo-cli/neo-cli.csproj" + # Remove the PackageReference to Neo + sed -i '//i \ ' $csproj_path + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.x' # Adjust according to the actual .NET Core version of neo-node + + - name: Restore and build neo-node + run: | + cd neo-node/neo-cli + dotnet restore + dotnet build diff --git a/.github/workflows/test_devpack.yml b/.github/workflows/test_devpack.yml new file mode 100644 index 0000000000..dd0756e6f8 --- /dev/null +++ b/.github/workflows/test_devpack.yml @@ -0,0 +1,43 @@ +name: Validate neo-devpack-dotnet 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-devpack-dotnet + uses: actions/checkout@v2 + with: + repository: neo-project/neo-devpack-dotnet + path: ./neo-devpack-dotnet + + - name: Patch neo-devpack-dotnet .csproj to use local neo + run: | + # Remove the PackageReference to Neo + sed -i '//i \ ' ./neo-devpack-dotnet/src/Neo.Compiler.CSharp/Neo.Compiler.CSharp.csproj + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.X # Adjust according to the actual .NET Core version of neo-devpack-dotnet + + - name: Restore and build neo-devpack-dotnet + run: | + cd neo-devpack-dotnet/src/Neo.Compiler.CSharp + dotnet restore + dotnet build + + - name: Test neo-devpack-dotnet + run: | + cd neo-devpack-dotnet/src/Neo.Compiler.CSharp + dotnet test diff --git a/.github/workflows/test_plugins.yml b/.github/workflows/test_plugins.yml new file mode 100644 index 0000000000..4ab5eeeff1 --- /dev/null +++ b/.github/workflows/test_plugins.yml @@ -0,0 +1,48 @@ +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: | + # Path to Directory.Build.props in neo-modules + props_path="./neo-modules/src/Directory.Build.props" + # Remove the PackageReference to Neo + sed -i '//i \ ' $props_path + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.x' # Adjust according to the actual .NET Core version of neo-modules + + - name: Restore and build neo-modules + run: | + cd neo-modules/src + dotnet restore + dotnet build + + # Add test steps + - name: Test neo-modules + run: | + cd neo-modules/tests + dotnet test +