Skip to content

Commit

Permalink
Bump MASES.JCOBridge from 2.5.17 to 2.5.19 in /src/net (#572)
Browse files Browse the repository at this point in the history
* Bump MASES.JCOBridge from 2.5.17 to 2.5.18 in /src/net

Bumps MASES.JCOBridge from 2.5.17 to 2.5.18.

---
updated-dependencies:
- dependency-name: MASES.JCOBridge
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update templates

* Added .NET 9 and removed .NET 6

* Update to JCOBridge 2.5.19

* Update workflows to support .NET 9 while new runner images are deployed

* Update target JCOBridge license

* Test update

* Update test execution

* Try to log error during initialize

* Try add .NET setup

* Verify what the folder contains to test it locally

* Avoid .NET Core install on Windows

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: masesdevelopers <94312179+masesdevelopers@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and masesdevelopers authored Dec 3, 2024
1 parent 5af2aed commit 424871d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 19 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ jobs:
path: ./bin/
key: JNet_${{ github.run_number }}_${{ github.run_attempt }}_bin_${{ github.sha }}

- uses: actions/upload-artifact@v4
with:
name: JNetBin
path: .\bin\

execute_tests:
needs: build_windows
strategy:
Expand All @@ -271,14 +276,15 @@ jobs:
framework: net462
- os: macos-latest
framework: net462
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net462
- jdk_vendor: oracle
jdk_version: 11

runs-on: ${{ matrix.os }}
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}

steps:
- name: Restore JNet bin from cache
uses: actions/cache/restore@v4
Expand All @@ -289,6 +295,7 @@ jobs:
key: JNet_${{ github.run_number }}_${{ github.run_attempt }}_bin_${{ github.sha }}

- uses: actions/setup-dotnet@v4
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'macos-13' }}
with:
dotnet-version: |
6.x
Expand All @@ -305,16 +312,13 @@ jobs:
run: |
dotnet ./bin/${{ matrix.framework }}/JNetTest.dll
dotnet ./bin/${{ matrix.framework }}/JNetByteBufferTest.dll
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}
- name: WINDOWS ONLY - Execute tests on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }}
if: ${{ matrix.os == 'windows-latest' }}
run: |
.\bin\${{ matrix.framework }}\JNetTest.exe
.\bin\${{ matrix.framework }}\JNetByteBufferTest.exe
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}
- uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -334,9 +338,15 @@ jobs:
exclude:
- jdk_vendor: oracle
jdk_version: 11

runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
9.x
- name: Restore JNet bin from cache
uses: actions/cache/restore@v4
with:
Expand All @@ -359,8 +369,6 @@ jobs:
Register-PSRepository -Name Local_Nuget_Feed -SourceLocation $env:GITHUB_WORKSPACE\bin -PublishLocation $env:GITHUB_WORKSPACE\bin -InstallationPolicy Trusted
Install-Module MASES.JNetPS -Repository Local_Nuget_Feed
${{ github.workspace }}/bin/JNetPSTest.ps1
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}
- name: Execute PowerShell test on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }}
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -370,8 +378,6 @@ jobs:
Register-PSRepository -Name Local_Nuget_Feed -SourceLocation $env:GITHUB_WORKSPACE\bin -PublishLocation $env:GITHUB_WORKSPACE\bin -InstallationPolicy Trusted
Install-Module MASES.JNetPS -Repository Local_Nuget_Feed
${{ github.workspace }}\bin\JNetPSTest.ps1
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}
- name: Execute PowerShell 5.1 test on ${{ matrix.os }} with ${{ matrix.jdk_vendor }} ${{ matrix.jdk_version }}
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -380,8 +386,6 @@ jobs:
$env:DOTNET_CLI_UI_LANGUAGE="en_US"
Install-Module MASES.JNetPS -Repository Local_Nuget_Feed
${{ github.workspace }}\bin\JNetPSTest.ps1
env:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ENCODED_2_5_19 }}
- uses: actions/upload-artifact@v4
if: failure()
Expand Down
23 changes: 20 additions & 3 deletions tests/net/JNetByteBufferTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class Program
const int iterations = 100;
static void Main(string[] args)
{
JNetTestCore.ApplicationHeapSize = "4G";
JNetTestCore.CreateGlobalInstance();
var appArgs = JNetTestCore.FilteredArgs;
Console.WriteLine("Starting JNetByteBufferTest");

Initialize();

Console.WriteLine("Start insert from CLR to JVM");

Expand All @@ -51,6 +51,23 @@ static void Main(string[] args)
}
}

static void Initialize()
{
try
{
JNetTestCore.ApplicationHeapSize = "4G";
JNetTestCore.CreateGlobalInstance();
var appArgs = JNetTestCore.FilteredArgs;

System.Console.WriteLine($"Initialized JNetTestCore, remaining arguments are {string.Join(" ", appArgs)}");
}
catch (Exception ex)
{
System.Console.WriteLine(ex);
throw;
}
}

static void TestInsertByteBuffers(int iteration, int length)
{
byte[] bytes = new byte[length];
Expand Down
22 changes: 19 additions & 3 deletions tests/net/JNetTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using System.Threading.Tasks;
using System.Linq;
using Java.Nio;
using MASES.JCOBridge.C2JBridge.JVMInterop;
using MASES.JNet.Specific;

namespace MASES.JNetTest
Expand All @@ -34,8 +33,9 @@ class Program
{
static void Main(string[] args)
{
JNetTestCore.CreateGlobalInstance();
var appArgs = JNetTestCore.FilteredArgs;
System.Console.WriteLine("Starting JNetTest");

Initialize();

TestExtensions();

Expand All @@ -58,6 +58,22 @@ static void Main(string[] args)
TestAsyncIterator().Wait();
}

static void Initialize()
{
try
{
JNetTestCore.CreateGlobalInstance();
var appArgs = JNetTestCore.FilteredArgs;

System.Console.WriteLine($"Initialized JNetTestCore, remaining arguments are {string.Join(" ", appArgs)}");
}
catch (Exception ex)
{
System.Console.WriteLine(ex);
throw;
}
}

static void TestSingleton()
{
System.Console.WriteLine("TestSingleton");
Expand Down

0 comments on commit 424871d

Please sign in to comment.