Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eo pipefail

if [ -f Cargo.toml ]; then
# Ensure that all targets can be built.
cargo build -r --all-targets
cargo build --all-targets

#Ensure that code is correctly formatted.
cargo fmt --check || (echo "Run cargo fmt to fix formatting" && exit 1)
Expand Down
22 changes: 11 additions & 11 deletions scripts/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ if [ -f Cargo.toml ]; then
"$dir/pre-commit"

# Ensure that the public API works.
cargo test -r --doc
cargo test --doc

# Ensure that no_std build succeeds.
# Build for a target that has no std available.
if command -v rustup > /dev/null; then
rustup target add thumbv7m-none-eabi
(cd tests/ensure_no_std; cargo build -r --target thumbv7m-none-eabi --no-default-features --features opa-no-std)
(cd tests/ensure_no_std; cargo build -r --target thumbv7m-none-eabi)
Comment thread
anakrish marked this conversation as resolved.
fi

# Ensure that we can build with only std.
cargo build -r --example regorus --no-default-features --features std
cargo build --example regorus --no-default-features --features std

# Ensure that we can build with all features.
cargo build -r --all-features
cargo build --all-features

# Ensure that all tests pass.
cargo test -r
cargo test -r --test aci
cargo test -r --test kata
cargo test
cargo test --test aci
cargo test --test kata

# Ensure that all tests pass with extensions
cargo test -r --features rego-extensions
cargo test -r --test aci --features rego-extensions
cargo test -r --test kata --features rego-extensions
cargo test --features rego-extensions
cargo test --test aci --features rego-extensions
cargo test --test kata --features rego-extensions

# Ensure that OPA conformance tests don't regress.
cargo test -r --features opa-testutil,serde_json/arbitrary_precision,rego-extensions --test opa -- $(tr '\n' ' ' < tests/opa.passing)
cargo test --features opa-testutil,serde_json/arbitrary_precision,rego-extensions --test opa -- $(tr '\n' ' ' < tests/opa.passing)
fi
Loading