Skip to content

Run OPA Tests

Run OPA Tests #831

Workflow file for this run

name: Run OPA Tests
on:
# Run tests on each commit, newly opened/reopened PR, and
# PR review submission (e.g. approval)
workflow_dispatch:
push:
paths:
- "**.rego"
pull_request:
types: [opened, reopened]
branches:
- "main"
paths:
- "**.rego"
pull_request_review:
types: [submitted]
jobs:
Run-OPA-Tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup OPA
uses: open-policy-agent/setup-opa@v2
with:
version: latest
- name: Run OPA Check
run: opa check rego Testing/RegoTests --strict
- name: Run OPA Tests
run: opa test rego/*.rego Testing/RegoTests/**/*.rego -v
- name: Setup Regal
uses: StyraInc/setup-regal@v0.2.0
with:
version: v0.15.0
- name: Run Regal Lint
run: regal lint --format github rego Testing