CI/CD Fails After Adding Cesium for Unity – Partial Method and Reinterop Errors

I’m integrating Cesium for Unity into a Unity project that uses GitHub Actions for CI/CD (via game-ci/unity-builder).

The project builds fine using the git flow before i added the package and builds fine locally with the cesium packages, but when I added the Cesium package, the GitHub Actions workflow started failing with compilation errors.

-Missing Implementation for Partial Methods
error CS8795: Partial method '...' must have an implementation part because it has accessibility modifiers.

-Missing ReinteropNativeImplementationAttribute / ReinteropNativeImplementation
error CS0246: The type or namespace name 'ReinteropNativeImplementationAttribute' could not be found (are you missing a using directive or an assembly reference?)

Environment

  • Unity version: 6000.1.9f1
  • Unity CI: game-ci/unity-builder@v4
  • OS: Ubuntu 24.04 GitHub runner
  • Build type: Headless CI/CD (no editor UI)

Could you please clarify:

  1. Is there a Reinterop Unity package or DLL I need to include separately?
  2. Are there any known steps or CI-specific configurations needed to build Cesium for Unity in headless pipelines?
  3. Is Cesium currently intended to support CI workflows via game-ci/unity-builder?

Any official guidance, sample CI config, or manifest examples would be appreciated.

Thanks in advance!

YAML file:

name: Build project

on:
  push:
    branches:
      - master
  pull_request: {}
  workflow_dispatch: {}

jobs:
  checklicense:
    name: Check for UNITY_LICENSE in GitHub Secrets
    runs-on: ubuntu-latest
    outputs:
      is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }}
    steps:
      - name: Check whether Unity activation should be done
        id: checklicense_job
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        run: |
          if [[ -n "${UNITY_LICENSE}" ]]; then
            echo "is_unity_license_set=true" >> $GITHUB_OUTPUT
          else
            echo "is_unity_license_set=false" >> $GITHUB_OUTPUT
          fi

  buildForAllSupportedPlatforms:
    name: Build for ${{ matrix.targetPlatform }}
    needs: checklicense
    if: needs.checklicense.outputs.is_unity_license_set == 'true'
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        targetPlatform:
          - StandaloneWindows64 # Build a Windows 64-bit standalone.
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          lfs: true

      - uses: actions/cache@v3
        with:
          path: Library
          key: Library-${{ matrix.targetPlatform }}
          restore-keys: Library-

      - if: matrix.targetPlatform == 'Android'
        uses: jlumbroso/free-disk-space@v1.3.1

      - uses: game-ci/unity-builder@v4
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          targetPlatform: ${{ matrix.targetPlatform }}

      - uses: actions/upload-artifact@v4
        with:
          name: Build-${{ matrix.targetPlatform }}
          path: build/${{ matrix.targetPlatform }}

@laserraptor Cesium for Unity has its own CI config in its repo: cesium-unity/.github/workflows/build.yml at main · CesiumGS/cesium-unity · GitHub

It’s important to note that this is the packaging route to building Cesium for Unity - it will produce a build that’s ready to be imported through the Unity Package Manager. If that’s what you’re looking for, the relevant bits are probably:

- name: Build Reinterop
  run: |
    cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
    dotnet publish Reinterop~ -o .

And here:

- name: Build Package
  run: |
    cd d:\cesium\CesiumForUnityBuildProject\Packages\com.cesium.unity
    mkdir -p d:\cesium\temp
    # Store temp files on the D drive, which is much faster than the EBS-backed C drive.
    $ENV:TEMP="d:\cesium\temp"
    # We only need a release build of vcpkg dependencies
    $ENV:CESIUM_VCPKG_RELEASE_ONLY="TRUE"
    # Clear ANDROID_NDK_ROOT so that we use Unity's version
    Remove-Item Env:ANDROID_NDK_ROOT
    # Explicitly set the ezvcpkg path. Otherwise it will be `/.ezvcpkg` and the drive letter is ambiguous.
    $ENV:EZVCPKG_BASEDIR="D:/.ezvcpkg"
    # Run the build
    dotnet run --project Build~

If you’re looking instead to make an “in-place” build, you should take a look at the Developer Setup guide which gives instructions for setting up and building Cesium for Unity from source.

@azrogers All the instructions I found for building always seem to target Windows as build machines if I am not mistaken. Is there any documentation on how one would go about cross-compiling using Docker?

(As context: I am trying to get Cesium for Unity to compile using GitLabCI with the aforementioned game-ci in a Docker Container and are pretty much facing the same issue as OP)

@hv_nico I don’t have anything to share for Docker in particular, but the instructions should be mostly the same. The key part is that first Reinterop (the C#/C++ glue code generator component) needs to be built, then Unity needs to run so that Reinterop can run and generate the C++, then the CMake commands need to be invoked to build the C++ side, then the Unity player can be built as normal. The GitHub CI link there does include MacOS which might give you some information about building on non-Windows platforms, but many of the specifics you might have to figure out yourself.