name: Test Java Sources on: workflow_call: workflow_dispatch: env: RUSTC_WRAPPER: sccache # sccache: native GCS backend, credentials come from the runner pod via # Workload Identity (no secrets). SCCACHE_GCS_BUCKET: ${{ vars.SCCACHE_GCS_BUCKET }} SCCACHE_GCS_RW_MODE: READ_WRITE AWS_ACCESS_KEY_ID: "${{ secrets.CI_GCS_HMAC_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.CI_GCS_HMAC_SECRET_ACCESS_KEY }}" RUST_MIN_STACK: 8388608 # sccache cannot cache rustc invocations when incremental is on. CARGO_INCREMENTAL: 0 # Cap cargo parallelism at the k8s runner core budget. Java tests drive a # Rust build via mvn → sql-to-dbsp; without this cap arm64 runners OOM from # too many parallel linkers. Override via the CI_RUNNER_CORES repo variable; # the fallback matches the current 20-core pod. CARGO_BUILD_JOBS: ${{ vars.CI_RUNNER_CORES || 20 }} # Pin Maven's local repo so it matches the cache path regardless of the # container runner's $HOME. MAVEN_OPTS: -Dmaven.repo.local=/home/ubuntu/.m2/repository jobs: java-tests: if: ${{ !contains(vars.CI_SKIP_JOBS, 'java-tests') }} name: Execute Java Tests strategy: matrix: include: - runner: [gke-runners-amd64] - runner: [gke-runners-arm64] runs-on: ${{ matrix.runner }} container: image: us-central1-docker.pkg.dev/feldera-ci/ghcr-remote/feldera/feldera-dev:sha-a5ab793b8d261068867b9fdfad3f04157b2536fc steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Cache Cargo registry uses: ./.github/actions/feldera-gcs-cache with: # Crate downloads only, NOT target/: caching the multi-GB target/ # trees never paid off, and sccache already caches compiled crates. # registry/src is excluded, cargo regenerates it from registry/cache. path: | # Absolute paths: CARGO_HOME is /home/ubuntu/.cargo (feldera-dev image # env), while ~ expands to the runner's HOME (/github/home in container # jobs), so tilde paths would cache a directory cargo never writes. /home/ubuntu/.cargo/registry/cache /home/ubuntu/.cargo/registry/index /home/ubuntu/.cargo/git/db key: test-java-cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | test-java-cargo-${{ runner.os }}-${{ runner.arch }}- - name: Cache JVM build dependencies uses: ./.github/actions/feldera-gcs-cache with: path: | /home/ubuntu/.gradle /home/ubuntu/.m2/repository ./sql-to-dbsp-compiler/calcite key: test-java-jvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('sql-to-dbsp-compiler/calcite_version.env', 'sql-to-dbsp-compiler/**/pom.xml') }} restore-keys: | test-java-jvm-${{ runner.os }}-${{ runner.arch }}- # TODO: Avoid doing this twice and ideally download & reuse the JAR from build-java.yml workflow - name: Run build.sh run: ./build.sh working-directory: ./sql-to-dbsp-compiler if: ${{ vars.CI_DRY_RUN != 'true' }} env: CALCITE_BUILD_DIR: ./calcite GRADLE_HOME: /home/ubuntu/.gradle - name: Stop gradle daemon run: gradle --stop - name: Run mvn test run: mvn test --no-transfer-progress -B -pl SQL-compiler -Dsurefire.failIfNoSpecifiedTests=false working-directory: ./sql-to-dbsp-compiler if: ${{ vars.CI_DRY_RUN != 'true' }} - name: Run one quick SLT test if: ${{ vars.CI_DRY_RUN != 'true' }} run: mvn test --no-transfer-progress -B -Dsurefire.failIfNoSpecifiedTests=false -Dtest=RotateTests#quick working-directory: ./sql-to-dbsp-compiler - name: Print sccache stats run: | sccache --show-stats if: ${{ vars.CI_DRY_RUN != 'true' }}