generated from cisagov/ScubaGear
-
Notifications
You must be signed in to change notification settings - Fork 22
42 lines (36 loc) · 1001 Bytes
/
run_opa_tests.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
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 scubagoggles/rego scubagoggles/Testing/RegoTests --strict
- name: Run OPA Tests
run: opa test scubagoggles/rego/*.rego scubagoggles/Testing/RegoTests/**/*.rego -v
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: 0.27.0
- name: Run Regal Lint
run: regal lint --format github scubagoggles/rego scubagoggles/Testing/RegoTests