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: 60 env: DOTNET: dotnet CARGO: cargo PYTHON: python KOTLIN_VERSION: 2.2.21 FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true 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 - 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: Install Python package dependencies run: python -m pip install -e packages/cultcache-py -e packages/cultnet-py -e packages/cultmesh-py - name: Build TypeScript workspace dependencies run: npm run build --workspace packages/cultcache-ts - name: Build Kotlin interop peer shell: pwsh run: .\packages\cultmesh-kotlin\build.ps1 - name: Build CultNet TypeScript interop tests run: | npm run build --workspace packages/cultnet-ts npx tsc -p packages/cultnet-ts/tsconfig.test.json --pretty false - name: Verify TypeScript RUDP reliability run: npm test --workspace packages/cultnet-ts - name: Verify Python RUDP reliability run: | python -m unittest discover -s packages/cultcache-py/tests python -m unittest discover -s packages/cultnet-py/tests python -m unittest discover -s packages/cultmesh-py/tests - name: Verify Rust RUDP reliability run: cargo test --manifest-path packages/cultnet-rs/Cargo.toml rudp - name: Verify Rust CultMesh runtime-local surface run: cargo test --manifest-path packages/cultmesh-rs/Cargo.toml - name: Verify C# RUDP reliability run: dotnet test tests/GameCult.Networking.Tests/GameCult.Networking.Tests.csproj --filter "FullyQualifiedName~Rudp" - name: Interop RUDP Python lane timeout-minutes: 8 run: node --test --test-name-pattern "TypeScript and Python|Python and TypeScript" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js - name: Interop RUDP Rust lane timeout-minutes: 8 run: node --test --test-concurrency=1 --test-name-pattern "TypeScript and Rust|Rust and TypeScript" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js - name: Interop RUDP C# lane timeout-minutes: 8 run: node --test --test-name-pattern "TypeScript and C#|C# and TypeScript" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js - name: Interop RUDP Kotlin lane timeout-minutes: 8 run: node --test --test-name-pattern "TypeScript and Kotlin|Kotlin and TypeScript" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js - name: Interop RUDP impairment matrix timeout-minutes: 12 run: node --test --test-name-pattern "dropped|reordered|fragmented|disconnect|ping/pong" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js - name: Interop schema-v0 discovery lane timeout-minutes: 20 run: node --test --test-name-pattern "shared schema-v0 lane" packages/cultnet-ts/dist-test/test/interop/cultnet-interop.test.js