Repository navigation
52 lines (49 loc) · 1.51 KB
/
Copy pathtest-java.yaml
File metadata and controls
52 lines (49 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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@v7
- 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
# Caching `~/.cargo/bin/` breaks the rustup `cargo`/`rustc` symlinks
# on the new macos-15 runner image — see
# https://github.com/Swatinem/rust-cache/issues/341.
cache-bin: "false"
- name: Maven test
working-directory: prqlc/bindings/java/java/
run: ./mvnw test