Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 16 additions & 26 deletions .github/workflows/post-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,26 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Run End-to-End Test
run: |
KIND_VERSION=0.4.0
ISTIO_VERSION=1.5.0

# Download and install kind
curl -L https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-linux-amd64 --output kind && chmod +x kind && sudo mv kind /usr/local/bin/

# Create kind cluster
if [ -z $(kind get clusters) ]; then
kind create cluster
fi
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"

# Download and install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv kubectl /usr/local/bin/
- name: Build docker image
run: make image tag-latest

# Download and install Istio
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=${ISTIO_VERSION} sh - && \
mv istio-${ISTIO_VERSION} /tmp && \
cd /tmp/istio-${ISTIO_VERSION} && \
bin/istioctl install -y --set profile=demo
kubectl -n istio-system wait --for=condition=available --timeout=600s --all deployment
- name: Setup kind/istio
run: |
# install kind, kubectl, istio
make test-cluster

# Install bats
sudo apt-get update -y
sudo apt-get install -y bats

# Run the test
make update-istio-quickstart-version && make test-e2e
# Prepare quick_start.yaml
make update-istio-quickstart-version

# Make docker image available to k8s
kind load docker-image openpolicyagent/opa:latest-istio

- name: Run e2e tests
run: make test-e2e

# Delete the cluster
kind delete cluster
- name: Cleanup
run: kind delete cluster
33 changes: 32 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,35 @@ jobs:

- name: Golang Style and Lint Check
run: make check
timeout-minutes: 15
timeout-minutes: 15

e2e:
name: End-to-End Test
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Build docker image
run: make image tag-latest

- name: Setup kind/istio
run: |
# install kind, kubectl, istio
make test-cluster

# Install bats
sudo apt-get update -y
sudo apt-get install -y bats

# Prepare quick_start.yaml
make update-istio-quickstart-version

# Make docker image available to k8s
kind load docker-image openpolicyagent/opa:latest-istio

- name: Run e2e tests
run: make test-e2e

- name: Cleanup
run: kind delete cluster
11 changes: 6 additions & 5 deletions build/install-istio-with-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x

GOARCH=$(go env GOARCH)
GOOS=$(go env GOOS)
KIND_VERSION=0.4.0
KIND_VERSION=0.9.0
ISTIO_VERSION=1.7.0

# Download and install kind
Expand All @@ -17,15 +17,16 @@ if [ -z $(kind get clusters) ]; then
kind create cluster
fi

# Get kubeconfig
export KUBECONFIG="$(kind get kubeconfig-path --name=kind)"

# Download and install kubectl
curl -LO \
https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/${GOOS}/${GOARCH}/kubectl && chmod +x ./kubectl && sudo mv kubectl /usr/local/bin/

# Use kind cluster
kubectl cluster-info --context kind-kind

# Download and install Istio
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=${ISTIO_VERSION} sh - && mv istio-${ISTIO_VERSION} /tmp
cd /tmp/istio-${ISTIO_VERSION}
pushd /tmp/istio-${ISTIO_VERSION}
bin/istioctl install -y --set profile=demo
popd
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cd to pushd change doesn't really matter for the script, but it also doesn't hurt...

kubectl -n istio-system wait --for=condition=available --timeout=600s --all deployment