-
Notifications
You must be signed in to change notification settings - Fork 25
101 lines (92 loc) · 3.45 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Cargo Build & Test
on:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
get-branch-name:
runs-on: ubuntu-latest
steps:
- name: Get branch name
shell: bash
# The workflow is triggered by pull_request so we use `GITHUB_BASE_REF`
run: echo "branch_name=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT
id: get_branch_name
outputs:
branch_name: ${{ steps.get_branch_name.outputs.branch_name }}
build_and_test_java_hello_world:
name: java-hello-world
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Checkout cedar-examples
uses: actions/checkout@v3
- name: Checkout cedar-java
uses: actions/checkout@v3
with:
repository: cedar-policy/cedar-java
ref: release/2.3.x # Java example currently only builds for 2.3.3
path: ./cedar-java-hello-world/cedar-java
- name: rustup
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: cargo build CedarJavaFFI
working-directory: ./cedar-java-hello-world/cedar-java/CedarJavaFFI
run: cargo build
- name: Build cedar-java-hello-world
working-directory: ./cedar-java-hello-world
run: bash config.sh && ./gradlew build
- name: Run cedar-java-hello-world
working-directory: ./cedar-java-hello-world
run: ./gradlew test
run_example_use_cases:
name: run_example_use_cases
needs: get-branch-name
uses: ./.github/workflows/run_example_use_cases_reusable.yml
with:
cedar_policy_ref: "refs/heads/main" # use the latest commit on main
cedar_examples_ref: "${{ github.head_ref }}" # use the current PR's commit
build_rust_hello_world:
name: rust_hello_world
needs: get-branch-name
uses: ./.github/workflows/build_rust_hello_world_reusable.yml
with:
cedar_policy_ref: "refs/heads/main" # use the latest commit on main
cedar_examples_ref: "${{ github.head_ref }}" # use the current PR's commit
build_tiny_todo:
name: tinytodo
needs: get-branch-name
uses: ./.github/workflows/build_tiny_todo_reusable.yml
with:
cedar_policy_ref: "refs/heads/main" # use the latest commit on main
cedar_examples_ref: "${{ github.head_ref }}" # use the current PR's commit
build_and_run_oopsla_benchmarks:
name: OOPSLA2024 benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout cedar-examples
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
push: false
context: oopsla2024-benchmarks
file: oopsla2024-benchmarks/Dockerfile
tags: cedar-benchmarks:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run benchmarks inside Docker container
uses: addnab/docker-run-action@v3
with:
image: cedar-benchmarks:latest
# run a small run, that completes fast, but will still make sure things work properly
run: cargo run --release -- bench --app gdrive,github,tiny-todo,gdrive-templates,github-templates --engine cedar,open-fga,rego,cedar-opt --num-hierarchies 3 --num-requests 3 --num-entities 1,2,3