Running tests and checks for policies #2
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
name: Test and Check | |
run-name: Running tests and checks for policies | |
on: [push] | |
jobs: | |
Test-And-Check: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
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 Tests | |
run: opa test policies | |
- name: Run OPA Check | |
run: opa check policies | |
- name: Run OPA Build | |
run: | | |
mkdir -p dist/ | |
opa build -b policies -o dist/bundle.tar.gz | |
- name: Bundle | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist/bundle.tar.gz |