-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (47 loc) · 1.23 KB
/
policy-ci.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
43
44
45
46
47
48
49
50
51
name: Policy CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Setup OPA
uses: open-policy-agent/setup-opa@34a30e8a924d1b03ce2cf7abe97250bbb1f332b5 # v2.2.0
with:
version: latest
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Check
run: >
opa check ./examples/policies
--schema ./examples/schemas
--strict
--format pretty
- name: Test
run: opa test -v ./examples/policies
package:
name: Package
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Setup OPA
uses: open-policy-agent/setup-opa@34a30e8a924d1b03ce2cf7abe97250bbb1f332b5 # v2.2.0
with:
version: latest
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Build Bundle
run: opa build -o ./bundle.tar.gz -r ${{ github.sha }} ./examples/policies
- uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4
with:
name: policy-bundle
path: ./bundle.tar.gz