-
Notifications
You must be signed in to change notification settings - Fork 15
70 lines (68 loc) · 2.52 KB
/
build_and_test_drt_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
66
67
68
69
70
name: Build and Test DRT
on:
workflow_call:
inputs:
cedar_spec_ref:
required: false
default: "main"
type: string
cedar_policy_ref:
required: false
default: "main"
type: string
jobs:
build_and_test_drt:
name: Build and test DRT
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
steps:
- name: Checkout cedar-spec
uses: actions/checkout@v4
with:
repository: cedar-policy/cedar-spec
ref: ${{ inputs.cedar_spec_ref }}
path: ./cedar-spec
- name: checkout cedar
uses: actions/checkout@v4
with:
repository: cedar-policy/cedar
path: ./cedar-spec/cedar
ref: ${{ inputs.cedar_policy_ref }}
- name: Install Lean
shell: bash
run: |
wget https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh
bash elan-init.sh -y
- name: Prepare Rust build
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: cargo fmt (cedar-policy-generators)
working-directory: ./cedar-spec/cedar-policy-generators
run: cargo fmt --all --check
- name: cargo fmt (cedar-drt)
working-directory: ./cedar-spec/cedar-drt
run: cargo fmt --all --check
- name: cargo fmt (cedar-drt/fuzz/)
working-directory: ./cedar-spec/cedar-drt/fuzz
run: cargo fmt --all --check
- name: cargo build (cedar-policy-generators)
working-directory: ./cedar-spec/cedar-policy-generators
run: RUSTFLAGS="-D warnings -F unsafe-code" cargo build --verbose
- name: cargo test (cedar-policy-generators)
working-directory: ./cedar-spec/cedar-policy-generators
run: cargo test --verbose
- name: Build Lean libraries
working-directory: ./cedar-spec/cedar-lean
run: source ~/.profile && ../cedar-drt/build_lean_lib.sh
- name: cargo build (cedar-drt/)
shell: bash
working-directory: ./cedar-spec/cedar-drt
run: source ~/.profile && source set_env_vars.sh && cargo build
- name: cargo build (cedar-drt/fuzz/)
working-directory: ./cedar-spec/cedar-drt/fuzz
run: source ~/.profile && source ../set_env_vars.sh && RUSTFLAGS="--cfg=fuzzing" cargo build
- name: cargo test (cedar-drt/fuzz/)
working-directory: ./cedar-spec/cedar-drt/fuzz
run: source ~/.profile && source ../set_env_vars.sh && cargo test -- --nocapture