diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c3f2cf0..16ee92d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,16 +78,25 @@ jobs: - name: Prepare configuration files run: | - Copy-Item .github\workflows\zookeeper.properties -Destination bin\zookeeper.properties -Force - Copy-Item .github\workflows\server.properties -Destination bin\server.properties -Force + Copy-Item .github\workflows\zookeeper.properties -Destination bin\net6.0\zookeeper.properties -Force + Copy-Item .github\workflows\server.properties -Destination bin\net6.0\server.properties -Force + Copy-Item .github\workflows\zookeeper.properties -Destination bin\net8.0\zookeeper.properties -Force + Copy-Item .github\workflows\server.properties -Destination bin\net8.0\server.properties -Force - - name: Save KEFCore bin in cache + - name: Save KEFCore net6.0 bin in cache uses: actions/cache/save@v4 with: enableCrossOsArchive: true - path: ./bin/ - key: KEFCore_bin_${{ github.sha }} - + path: ./bin/net6.0/ + key: KEFCore_net6.0_bin_${{ github.sha }} + + - name: Save KEFCore net8.0 bin in cache + uses: actions/cache/save@v4 + with: + enableCrossOsArchive: true + path: ./bin/net8.0/ + key: KEFCore_net8.0_bin_${{ github.sha }} + execute_tests_linux: needs: build_windows services: @@ -115,22 +124,32 @@ jobs: runs-on: 'ubuntu-latest' steps: - - name: Restore KEFCore bin from cache + - name: Restore KEFCore ${{ matrix.framework }} bin from cache uses: actions/cache/restore@v4 with: fail-on-cache-miss: true enableCrossOsArchive: true - path: ./bin/ - key: KEFCore_bin_${{ github.sha }} + path: ./bin/${{ matrix.framework }}/ + key: KEFCore_${{ matrix.framework }}_bin_${{ github.sha }} - name: Set up JDK distribution uses: actions/setup-java@v4 with: # running setup-java again overwrites the settings.xml distribution: ${{ matrix.jdk_vendor }} java-version: ${{ matrix.jdk_version }} + + - name: Executing KNetReplicator Benchmark on Ubuntu with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetReplicator.json localhost:9092 + env: + JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} - - name: Executing MASES.EntityFrameworkCore.KNet.Test.Benchmark on Ubuntu with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} - run: dotnet ./bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ./bin/${{ matrix.framework }}/Benchmark.KNetStreams.json localhost:9092 + - name: Executing KNetStreams Raw Benchmark on Ubuntu with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetStreams.Raw.json localhost:9092 + env: + JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} + + - name: Executing KNetStreams Buffered Benchmark on Ubuntu with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetStreams.Buffered.json localhost:9092 env: JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} @@ -153,13 +172,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Restore KEFCore bin from cache + - name: Restore KEFCore ${{ matrix.framework }} bin from cache uses: actions/cache/restore@v4 with: fail-on-cache-miss: true enableCrossOsArchive: true - path: ./bin/ - key: KEFCore_bin_${{ github.sha }} + path: ./bin/${{ matrix.framework }}/ + key: KEFCore_${{ matrix.framework }}_bin_${{ github.sha }} - name: Set up JDK distribution uses: actions/setup-java@v4 @@ -176,14 +195,25 @@ jobs: - name: Start Kafka on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} shell: pwsh run: | - Start-Process -FilePath knet -ArgumentList ( 'zookeeperstart', '${{ github.workspace }}/bin/zookeeper.properties' ) - Start-Process -FilePath knet -ArgumentList ( 'kafkastart', '${{ github.workspace }}/bin/server.properties' ) + Start-Process -FilePath knet -ArgumentList ( 'zookeeperstart', '${{ github.workspace }}/bin/${{ matrix.framework }}/zookeeper.properties' ) + Start-Process -FilePath knet -ArgumentList ( 'kafkastart', '${{ github.workspace }}/bin/${{ matrix.framework }}/server.properties' ) env: JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} - - name: Executing MASES.EntityFrameworkCore.KNet.Test.Benchmark on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + - name: Executing KNetReplicator Benchmark on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetReplicator.json localhost:9092 + env: + JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} + + - name: Executing KNetStreams Raw Benchmark on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} shell: pwsh - run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetStreams.json localhost:9092 + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetStreams.Raw.json localhost:9092 + env: + JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} + + - name: Executing KNetStreams Buffered Benchmark on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }} + shell: pwsh + run: dotnet ${{ github.workspace }}/bin/${{ matrix.framework }}/MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}/bin/${{ matrix.framework }}/Benchmark.KNetStreams.Buffered.json localhost:9092 env: JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} @@ -205,4 +235,31 @@ jobs: # if: ${{ matrix.os == 'windows-latest' }} # run: dotnet ${{ github.workspace }}\bin\${{ matrix.framework }}\MASES.EntityFrameworkCore.KNet.Test.Benchmark.dll ${{ github.workspace }}\bin\${{ matrix.framework }}\Benchmark.KNetStreams.json localhost:9092 # env: - # JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} \ No newline at end of file + # JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }} + + final_cleanup: + needs: [ execute_tests_linux, execute_tests_other ] + if: "always()" + runs-on: ubuntu-latest + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + with: + fetch-depth: '1' + + - name: Clear caches + run: | + gh extension install actions/gh-actions-cache + echo "Fetching list of cache key" + cacheKeysForPR=$(gh actions-cache list --key KEFCore_ ) + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + gh actions-cache delete $cacheKey --confirm + done + echo "Done" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.Buffered.json similarity index 100% rename from test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json rename to test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.Buffered.json diff --git a/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.Raw.json b/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.Raw.json new file mode 100644 index 0000000..4613d2f --- /dev/null +++ b/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.Raw.json @@ -0,0 +1,7 @@ +{ + "DatabaseName": "TestDBBenchmark", + "UseCompactedReplicator": false, + "UseByteBufferDataTransfer": false, + "BootstrapServers": "192.168.0.101:9092", + "NumberOfExecutions": 10 +} diff --git a/test/KEFCore.Benchmark.Test/KEFCore.Benchmark.Test.csproj b/test/KEFCore.Benchmark.Test/KEFCore.Benchmark.Test.csproj index 086884d..b224d7e 100644 --- a/test/KEFCore.Benchmark.Test/KEFCore.Benchmark.Test.csproj +++ b/test/KEFCore.Benchmark.Test/KEFCore.Benchmark.Test.csproj @@ -14,10 +14,13 @@ + + PreserveNewest + PreserveNewest - + PreserveNewest diff --git a/test/KEFCore.Benchmark.Test/Program.cs b/test/KEFCore.Benchmark.Test/Program.cs index 9cb657d..8c62a16 100644 --- a/test/KEFCore.Benchmark.Test/Program.cs +++ b/test/KEFCore.Benchmark.Test/Program.cs @@ -188,6 +188,7 @@ join pg in context.Posts on op.BlogId equals pg.BlogId catch (Exception ex) { ProgramConfig.ReportString(ex.ToString()); + Environment.ExitCode = 1; } finally { diff --git a/test/KEFCore.Complex.Test/Program.cs b/test/KEFCore.Complex.Test/Program.cs index c43c080..3e48937 100644 --- a/test/KEFCore.Complex.Test/Program.cs +++ b/test/KEFCore.Complex.Test/Program.cs @@ -183,7 +183,8 @@ join pg in context.Posts on op.BlogId equals pg.BlogId } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + ProgramConfig.ReportString(ex.ToString()); + Environment.ExitCode = 1; } finally { diff --git a/test/KEFCore.StreamTest/Program.cs b/test/KEFCore.StreamTest/Program.cs index 7c856d6..1687e68 100644 --- a/test/KEFCore.StreamTest/Program.cs +++ b/test/KEFCore.StreamTest/Program.cs @@ -185,7 +185,8 @@ join pg in context.Posts on op.BlogId equals pg.BlogId } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + ProgramConfig.ReportString(ex.ToString()); + Environment.ExitCode = 1; } finally { diff --git a/test/KEFCore.Test/Program.cs b/test/KEFCore.Test/Program.cs index 95ca547..e66bf63 100644 --- a/test/KEFCore.Test/Program.cs +++ b/test/KEFCore.Test/Program.cs @@ -190,7 +190,8 @@ join pg in context.Posts on op.BlogId equals pg.BlogId } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + ProgramConfig.ReportString(ex.ToString()); + Environment.ExitCode = 1; } finally {