File tree Expand file tree Collapse file tree 3 files changed +37
-9
lines changed
Expand file tree Collapse file tree 3 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:18.04
2+ RUN apt-get update && apt-get install -y curl
3+ RUN curl -L -o /opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64
4+ RUN chmod 755 /opa
5+ RUN /opa version
6+ COPY entrypoint.sh /
7+ RUN chmod +x /entrypoint.sh
8+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1- name : OPA Test
2- description : Run Open Policy Agent tests
3- author : Petro Protsakh
1+ name : " OPA Test"
2+ description : " Run Open Policy Agent tests"
3+ author : " Petro Protsakh"
44branding :
55 icon : check-square
66 color : green
77inputs :
88 tests :
9- description : Rego file or directory path where to discover tests. Defaults to repository root.
9+ description : " Rego file or directory path where to discover tests. Defaults to repository root."
1010 required : false
1111 default : ./
12+ options :
13+ description : " Additional OPA command line flags. Example: `--verbose --timeout 3`. See `opa test --help` for more."
14+ required : false
1215runs :
1316 using : docker
14- image : docker://openpolicyagent/opa:latest
15- args :
16- - test
17- - ${{ inputs.tests }}
18- - -v
17+ image : Dockerfile
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ printf " \n\n"
4+ echo " # Open Policy Agent"
5+ /opa version
6+ printf " \n\n"
7+
8+ IFS=' ;'
9+ mapfile -t lines < <( echo " $INPUT_TESTS " | grep -v " ^$" )
10+
11+ e_code=0
12+ for line in " ${lines[@]} " ; do
13+ read -r -a args <<< " $line"
14+ cmd=" /opa test ${args[*]} $INPUT_OPTIONS "
15+ echo " 🚀 Running: $cmd "
16+ printf " \n"
17+ eval " $cmd " || e_code=1
18+ printf " \n\n"
19+ done
20+
21+ exit $e_code
You can’t perform that action at this time.
0 commit comments