Repository navigation
66 lines (63 loc) · 2.11 KB
/
Copy pathtest-java.yaml
File metadata and controls
66 lines (63 loc) · 2.11 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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"
# `./mvnw` downloads the Maven distribution and every dependency from
# Maven Central on each run, and Maven Central rate-limits CI runners
# with HTTP 429 (#6603, #6614). Caching `~/.m2` skips those downloads.
- name: 💰 Cache Maven
uses: actions/cache@v6
with:
path: |
~/.m2/repository
~/.m2/wrapper
key:
${{ runner.os }}-maven-${{
hashFiles('prqlc/bindings/java/java/pom.xml',
'prqlc/bindings/java/java/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: ${{ runner.os }}-maven-
- name: Maven test
working-directory: prqlc/bindings/java/java/
run: ./mvnw test