-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update CI workflows and test script
- Simplify find calls and remove extra greps - Update `run_policy_tests.sh` to exit non-0 and print an error on failures (for local use) - Update `actions/checkout` to `v4` - Update setup-regal workflow to v1 (note: keeping lint version at `v0.11.0`, since the latest version seems to have a number of issues with the current config
- Loading branch information
Showing
2 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
#!/bin/bash | ||
|
||
tests=$(find . -type f -regex '.*_test\.rego$') | ||
STATUS=0 | ||
|
||
tests=$(find . -type f -name '*_test\.rego') | ||
for test in $tests; do | ||
opa test -v $test ${test/_test.rego/.rego} | ||
opa test -v "$test" "${test/_test\.rego/.rego}" | ||
((STATUS=$STATUS + $?)) | ||
echo | ||
done | ||
|
||
# Instead of exiting on first failure as we would with "-e" set, exit at the | ||
# end with sum of exit codes. | ||
if [ $STATUS -gt 0 ]; then | ||
echo "Failures detected: exiting with status $STATUS" >&2 | ||
fi | ||
|
||
exit $STATUS |