-
Notifications
You must be signed in to change notification settings - Fork 32
51 lines (43 loc) · 1 KB
/
test-rego.yaml
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
43
44
45
46
47
48
49
50
51
name: test rego
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
merge_group:
workflow_dispatch:
env:
GO_VERSION: "1.23"
jobs:
opa-tests:
name: OPA tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Rego Check
run: go run ./cmd/opa check lib checks --strict --v0-v1
- name: Setup Regal
uses: StyraInc/setup-regal@33a142b1189004e0f14bf42b15972c67eecce776 # v1
with:
version: 0.29
- name: Lint Rego
run: make lint-rego
- name: OPA Format
run: |
make fmt-rego
if [ -n "$(git status --porcelain)" ]; then
echo "Run 'make fmt-rego' and push it"
exit 1
fi
- name: Test Rego checks
run: make test-rego