diff options
author | Derek Bailey <derekbailey@google.com> | 2021-12-13 11:51:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 11:51:27 -0800 |
commit | c555ee8fac95b1520225d9c34d73d3e5beb97e52 (patch) | |
tree | acc134e90021761d5af813b11386e9ffc36cd52d | |
parent | b92bb0584d056cd237fa7059702e49617ee156b7 (diff) | |
download | flatbuffers-c555ee8fac95b1520225d9c34d73d3e5beb97e52.tar.gz flatbuffers-c555ee8fac95b1520225d9c34d73d3e5beb97e52.tar.bz2 flatbuffers-c555ee8fac95b1520225d9c34d73d3e5beb97e52.zip |
Add .NET test to github workflows (#6982)
-rw-r--r-- | .github/workflows/build.yml | 28 | ||||
-rw-r--r-- | appveyor.yml | 13 | ||||
-rw-r--r-- | tests/FlatBuffers.Test/FlatBuffersExampleTests.cs | 4 |
3 files changed, 30 insertions, 15 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85950fde..a69bfc50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,34 @@ jobs: - name: test run: Release\flattests.exe + build-dotnet-windows: + name: Build .NET Windows + runs-on: windows-latest + strategy: + matrix: + configuration: [ + '', + '-p:UnsafeByteBuffer=true', + # Fails two tests currently. + #'-p:EnableSpanT=true,UnsafeByteBuffer=true' + ] + steps: + - uses: actions/checkout@v1 + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v1.9.0 + with: + dotnet-version: '3.1.x' + - name: Build + run: | + cd tests\FlatBuffers.Test + dotnet new sln --force --name FlatBuffers.Core.Test + dotnet sln FlatBuffers.Core.Test.sln add FlatBuffers.Core.Test.csproj + dotnet build -c Release ${{matrix.configuration}} -o out FlatBuffers.Core.Test.sln + - name: Run + run: | + cd tests\FlatBuffers.Test + out\FlatBuffers.Core.Test.exe + build-mac: name: Build Mac runs-on: macos-latest diff --git a/appveyor.yml b/appveyor.yml index fdbe9e5c..c54aed0c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,19 +55,6 @@ test_script: - "npm run compile" - "cd tests" - "TypeScriptTest.bat" - - rem "---------------- C# -----------------" - # Have to compile this here rather than in "build" above because AppVeyor only - # supports building one project?? - - "cd FlatBuffers.Test" - - "dotnet new sln" - - "dotnet sln add FlatBuffers.Test.csproj" - - "nuget restore" - - "mkdir .tmp" - - "msbuild.exe /property:Configuration=Release;OutputPath=.tmp /verbosity:minimal FlatBuffers.Test.csproj" - - ".tmp\\FlatBuffers.Test.exe" - # Run tests with UNSAFE_BYTEBUFFER - - "msbuild.exe /property:Configuration=Release;UnsafeByteBuffer=true;OutputPath=.tmp /verbosity:minimal FlatBuffers.Test.csproj" - - ".tmp\\FlatBuffers.Test.exe" artifacts: - path: $(CONFIGURATION)\flatc.exe diff --git a/tests/FlatBuffers.Test/FlatBuffersExampleTests.cs b/tests/FlatBuffers.Test/FlatBuffersExampleTests.cs index 79a213c3..ec3b2eaa 100644 --- a/tests/FlatBuffers.Test/FlatBuffersExampleTests.cs +++ b/tests/FlatBuffers.Test/FlatBuffersExampleTests.cs @@ -116,13 +116,13 @@ namespace FlatBuffers.Test // Dump to output directory so we can inspect later, if needed #if ENABLE_SPAN_T var data = fbb.DataBuffer.ToSizedArray(); - string filename = @".tmp/monsterdata_cstest" + (sizePrefix ? "_sp" : "") + ".mon"; + string filename = @"monsterdata_cstest" + (sizePrefix ? "_sp" : "") + ".mon"; File.WriteAllBytes(filename, data); #else using (var ms = fbb.DataBuffer.ToMemoryStream(fbb.DataBuffer.Position, fbb.Offset)) { var data = ms.ToArray(); - string filename = @".tmp/monsterdata_cstest" + (sizePrefix ? "_sp" : "") + ".mon"; + string filename = @"monsterdata_cstest" + (sizePrefix ? "_sp" : "") + ".mon"; File.WriteAllBytes(filename, data); } #endif |