From e06e3f5b3aebecf2abb47ac0300349f5c4e95e5c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 16 Jun 2026 17:09:33 +0100 Subject: [PATCH] Add cross-runtime interop workflow --- .github/workflows/cultnet-interop.yml | 79 +++++++++++++++++++++++++++ packages/cultmesh-kotlin/build.ps1 | 4 +- packages/cultnet-ts/README.md | 10 ++-- 3 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/cultnet-interop.yml diff --git a/.github/workflows/cultnet-interop.yml b/.github/workflows/cultnet-interop.yml new file mode 100644 index 00000000..cfafd918 --- /dev/null +++ b/.github/workflows/cultnet-interop.yml @@ -0,0 +1,79 @@ +name: CultNet cross-runtime interop + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + interop: + name: C# / TypeScript / Rust / Python / Kotlin + runs-on: windows-latest + timeout-minutes: 30 + + env: + DOTNET: dotnet + CARGO: cargo + PYTHON: python + KOTLIN_VERSION: 2.2.21 + + steps: + - name: Check out CultLib + uses: actions/checkout@v4 + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + cache-dependency-path: | + packages/cultcache-ts/package-lock.json + packages/cultnet-ts/package-lock.json + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "21" + + - name: Install Kotlin compiler + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $version = $env:KOTLIN_VERSION + $zip = Join-Path $env:RUNNER_TEMP "kotlin-compiler-$version.zip" + $root = Join-Path $env:RUNNER_TEMP "kotlin" + Invoke-WebRequest "https://github.com/JetBrains/kotlin/releases/download/v$version/kotlin-compiler-$version.zip" -OutFile $zip + Expand-Archive -Path $zip -DestinationPath $root -Force + $kotlinHome = Join-Path $root "kotlinc" + if (-not (Test-Path (Join-Path $kotlinHome "bin\kotlinc.bat"))) { + throw "Kotlin compiler was not expanded to $kotlinHome" + } + "KOTLIN_HOME=$kotlinHome" | Out-File -FilePath $env:GITHUB_ENV -Append + "KOTLIN_JAVA_HOME=$env:JAVA_HOME" | Out-File -FilePath $env:GITHUB_ENV -Append + "$kotlinHome\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + + - name: Install Node dependencies + run: npm install --no-package-lock + + - name: Build Kotlin interop peer + shell: pwsh + run: .\packages\cultmesh-kotlin\build.ps1 + + - name: Run cross-runtime interop harness + run: npm run test:interop --workspace packages/cultnet-ts diff --git a/packages/cultmesh-kotlin/build.ps1 b/packages/cultmesh-kotlin/build.ps1 index 7802d8eb..aabacbcd 100644 --- a/packages/cultmesh-kotlin/build.ps1 +++ b/packages/cultmesh-kotlin/build.ps1 @@ -1,6 +1,6 @@ param( - [string] $KotlinHome = "C:\Program Files\Android\Android Studio\plugins\Kotlin\kotlinc", - [string] $JavaHome = "C:\Program Files\Android\Android Studio\jbr" + [string] $KotlinHome = $(if ($env:KOTLIN_HOME) { $env:KOTLIN_HOME } else { "C:\Program Files\Android\Android Studio\plugins\Kotlin\kotlinc" }), + [string] $JavaHome = $(if ($env:KOTLIN_JAVA_HOME) { $env:KOTLIN_JAVA_HOME } elseif ($env:JAVA_HOME) { $env:JAVA_HOME } else { "C:\Program Files\Android\Android Studio\jbr" }) ) $ErrorActionPreference = "Stop" diff --git a/packages/cultnet-ts/README.md b/packages/cultnet-ts/README.md index 96909b93..2cb36fa7 100644 --- a/packages/cultnet-ts/README.md +++ b/packages/cultnet-ts/README.md @@ -270,12 +270,10 @@ npm run test The cross-runtime interop harness is meant to run in GitHub Actions on `windows-latest`. -It expects these sibling checkouts inside the same workspace: - -- `CultNetTS` -- `cultnet-rs` -- `cultcache-rs` -- `CultLib` +It expects this CultLib checkout with the in-tree TypeScript, Rust, Python, +C#, and Kotlin packages present. The workflow installs the toolchains, builds +the Kotlin interop jar through `packages/cultmesh-kotlin/build.ps1`, and then +lets the TypeScript harness build the Rust and C# interop peers it needs. The workflow lives at [.github/workflows/cultnet-interop.yml](.github/workflows/cultnet-interop.yml)