-
Notifications
You must be signed in to change notification settings - Fork 37
40 lines (30 loc) · 1.28 KB
/
gatekeeper-k8s-integrationtests.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
name: Run gatekeeper-k8s-integrationtests.sh
on: [push, pull_request]
jobs:
kind:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate integration test data via kubeval
uses: redhat-cop/github-actions/confbatstest@master
with:
raw: find policy/* -regex '.*test_data\/integration\/.*$' -exec kubeval --openshift --strict --skip-kinds ServiceMonitor {} \;
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.8.0
- name: Test against KinD
run: |
confbatstest=$(docker images --filter=label=com.github.actions.name=confbatstest --format "{{.Repository}}:{{.Tag}}")
docker run --rm --network host --workdir /conftest --volume "/home/runner/.kube/":"/opt/app-root/src/.kube/" --volume "/home/runner/work/rego-policies/rego-policies":"/conftest" --entrypoint .github/workflows/tests-entrypoint.sh ${confbatstest}
- name: Get pods and events if tests failed
if: ${{ failure() }}
run: |
kubectl get nodes
echo ""
kubectl get namespaces
echo ""
kubectl get pods --all-namespaces
echo ""
kubectl get events --all-namespaces
echo ""
kubectl api-versions