-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (56 loc) · 1.97 KB
/
e2e.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
52
53
54
55
56
name: E2ETest
on: [pull_request]
jobs:
integration-tests:
name: create-kind-cluster
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-go@v1
with:
go-version: 1.13
- name: install-kind
run: |
GO111MODULE=on go get sigs.k8s.io/kind
- name: build-image
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --skip-publish
- name: create-kind-cluster
run: |
kind create cluster
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
kubectl cluster-info
kubectl get nodes -o wide
- name: Run some sanity checks
# kubectl is already installed on the Github Ubuntu worker
run: |
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
echo $KUBECONFIG
echo $HOME
ls -la ~/.kube
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide
kubectl get services --all-namespaces -o wide
- name: setup-opa
run: |
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
docker pull openpolicyagent/opa:0.13.4
docker pull openpolicyagent/kube-mgmt:0.9
kind load docker-image openpolicyagent/opa:0.13.4
kind load docker-image openpolicyagent/kube-mgmt:0.9
kubectl create namespace opa
kubectl apply -f tests/opa/fixtures/deployment-resources -n opa
kubectl wait -n opa --for=condition=available --timeout=600s deployment/opa
kubectl apply -n opa -f tests/opa/fixtures/opa-policy
sleep 20
- name: run-achorctl-opa-test
run: |
chmod a+x dist/anchorctl_linux_amd64/anchorctl
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
cp $KUBECONFIG $HOME/.kube/config
./dist/anchorctl_linux_amd64/anchorctl test -f tests/opa/anchor_test_ci.yaml -k kubetest
- name: cleanup
run: |
kind delete cluster