mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Details: - Implement complete Type enum with 12 variants: Any, Integer, Number, Boolean, Null, String, Array, Set, Object, Enum, Const, AnyOf - Add Schema wrapper struct with reference counting for efficient sharing - Support JSON Schema-compatible deserialization with serde - Implement discriminated subobjects for polymorphic type definitions - Add comprehensive test suite covering all type variants - Include Azure resource schema examples (Storage, VM, Key Vault, App Service) - Create meta-schema validation system with lazy static validator - Add extensive edge case and corner case test coverage - Implement custom deserializers for complex schema patterns This establishes the foundation for type checking and validation of Rego policies, particularly useful for cloud resource schemas and policy validation. Regorus's type system is a first of many features intended to enable type checking and various other constraints on Rego policies. The type system is inspired from: - JSON schema - Bicep Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: tests/release
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
schedule:
|
|
# Run at 8:00 AM every day
|
|
- cron: "0 8 * * *"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Format Check
|
|
run: cargo fmt --check
|
|
- name: Fetch
|
|
run: cargo fetch
|
|
- name: Build (all features)
|
|
run: cargo build -r --all-features --frozen
|
|
- name: Build
|
|
run: cargo build -r --frozen
|
|
- name: Test no_std
|
|
run: cargo test -r --no-default-features --frozen
|
|
- name: Build only std
|
|
run: cargo build -r --example regorus --no-default-features --features "std" --frozen
|
|
- name: Doc Tests
|
|
run: cargo test -r --doc --frozen
|
|
- name: Run tests
|
|
run: cargo test -r --frozen
|
|
- name: Run example
|
|
run: cargo run --example regorus --frozen -- eval -d examples/server/allowed_server.rego -i examples/server/input.json data.example
|
|
- name: Run tests (ACI)
|
|
run: cargo test -r --test aci --frozen
|
|
- name: Run tests (KATA)
|
|
run: cargo test -r --test kata --frozen
|
|
- name: Run tests (OPA Conformance)
|
|
run: >-
|
|
cargo test -r --test opa --frozen --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing)
|
|
- name: Run tests (Azure Policy)
|
|
run: >-
|
|
cargo test --frozen --features azure_policy
|