Add cross-runtime interop workflow

This commit is contained in:
Meta Vens 2026-06-16 17:09:33 +01:00
commit e06e3f5b3a
3 changed files with 85 additions and 8 deletions

79
.github/workflows/cultnet-interop.yml vendored Normal file
View file

@ -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

View file

@ -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"

View file

@ -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)