name: test-java on: workflow_call: inputs: oss: type: string default: '["ubuntu-24.04"]' workflow_dispatch: inputs: oss: type: string default: '["ubuntu-24.04"]' # We need consistent env vars across all workflows for the cache to work env: CARGO_TERM_COLOR: always CLICOLOR_FORCE: 1 RUSTFLAGS: "-C debuginfo=0" RUSTDOCFLAGS: "-Dwarnings" jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: ${{ fromJSON(inputs.oss) }} steps: - name: Checkout code uses: actions/checkout@v5 - run: ./.github/workflows/scripts/set_version.sh - name: Compute Cargo.lock hash shell: bash run: | if command -v sha256sum &> /dev/null; then echo "cargo_lock_hash=$(sha256sum Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_ENV" else echo "cargo_lock_hash=$(shasum -a 256 Cargo.lock | cut -d' ' -f1)" >> "$GITHUB_ENV" fi - name: 💰 Cache uses: Swatinem/rust-cache@v2 with: prefix-key: ${{ env.version }}-${{ env.cargo_lock_hash }} save-if: ${{ github.ref == 'refs/heads/main' }} shared-key: lib - name: Maven test working-directory: prqlc/bindings/java/java/ run: ./mvnw test