fix dotnet version #2
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: | | |
# Path to Directory.Build.props in neo-modules | |
props_path="./neo-modules/src/Directory.Build.props" | |
# Remove the PackageReference to Neo | |
sed -i '/<PackageReference Include="Neo"/d' $props_path | |
# Add a ProjectReference to the local Neo project | |
# Assuming the neo project's main .csproj is in its src/neo directory | |
# Adding the ProjectReference to the Directory.Build.props is unconventional, but for the sake of this example, let's do it. | |
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' # 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 | |