forked from cedar-policy/cedar-java
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 2.07 KB
/
run_cedar_java_reusable.yml
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
name: Build and Test CedarJava
on:
workflow_call:
inputs:
cedar_policy_ref:
required: false
type: string
cedar_java_ref:
required: false
default: "main"
type: string
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-14]
include:
- os: ubuntu-latest
name: Build on Linux
zigInstall: wget https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz -O - | tar xJ && echo "$(pwd)/zig-linux-x86_64-0.11.0" >> $GITHUB_PATH
- os: macos-14
name: Build on macOS
zigInstall: wget https://ziglang.org/download/0.11.0/zig-macos-x86_64-0.11.0.tar.xz -O - | tar xJ && echo "$(pwd)/zig-macos-x86_64-0.11.0" >> $GITHUB_PATH
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- name: Checkout Cedar Java
uses: actions/checkout@v4
with:
repository: cedar-policy/cedar-java
ref: ${{ inputs.cedar_java_ref }}
- name: Checkout cedar-policy
uses: actions/checkout@v4
with:
repository: cedar-policy/cedar
ref: ${{ inputs.cedar_policy_ref }}
path: ./cedar
- name: Prepare Rust Build
run: rustup install stable && rustup default stable
- name: Configure CedarJavaFFI for CI build
run: bash configure_ci_build.sh
- name: Check FFI Formatting
working-directory: CedarJavaFFI
run: cargo fmt --all --check
- name: Run FFI tests
working-directory: CedarJavaFFI
run: cargo test --all-features
- name: Install Zig
run: ${{ matrix.zigInstall }}
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: 'gradle'
- name: Build FFI and Java Libraries
working-directory: CedarJava
run: ./gradlew build
- name: Generate Java Documentation
working-directory: CedarJava
run: ./gradlew javadoc