Co-Authored-By: Yann Hamon <yann.hamon@contentful.com> Co-Authored-By: Kemal Akkoyun <kakkoyun@gmail.com> Signed-off-by: paulfantom <pawel@krupa.net.pl>
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
name: ci
|
|
on:
|
|
- push
|
|
- pull_request
|
|
env:
|
|
golang-version: '1.15'
|
|
kind-version: 'v0.9.0'
|
|
jobs:
|
|
generate:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- macos-latest
|
|
- ubuntu-latest
|
|
name: Generate
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ env.golang-version }}
|
|
- run: make --always-make generate validate && git diff --exit-code
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: Jsonnet linter
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: make --always-make lint
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
name: Jsonnet formatter
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: make --always-make fmt && git diff --exit-code
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
name: Unit tests
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: make --always-make test
|
|
e2e-tests:
|
|
name: E2E tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
kind-image:
|
|
- 'kindest/node:v1.19.0'
|
|
- 'kindest/node:v1.20.0'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Start KinD
|
|
uses: engineerd/setup-kind@v0.5.0
|
|
with:
|
|
version: ${{ env.kind-version }}
|
|
image: ${{ matrix.kind-image }}
|
|
- name: Wait for cluster to finish bootstraping
|
|
run: |
|
|
until [ "$(kubectl get pods --all-namespaces --no-headers | grep -cEv '([0-9]+)/\1')" -eq 0 ]; do
|
|
sleep 5s
|
|
done
|
|
kubectl cluster-info
|
|
kubectl get pods -A
|
|
- name: Create kube-prometheus stack
|
|
run: |
|
|
kubectl create -f manifests/setup
|
|
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
|
|
kubectl create -f manifests/
|
|
- name: Run tests
|
|
run: |
|
|
export KUBECONFIG="${HOME}/.kube/config"
|
|
make test-e2e
|