name: e2e on: pull_request: push: branches: - master jobs: kind: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Restore Go cache uses: actions/cache@v1 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Setup Go uses: actions/setup-go@v2-beta with: go-version: 1.14.x - name: Setup Kubernetes uses: engineerd/setup-kind@v0.4.0 with: image: kindest/node:v1.16.9 - name: Run test run: make test - name: Check if working tree is dirty run: | if [[ $(git diff --stat) != '' ]]; then git diff echo 'run make test and commit changes' exit 1 fi - name: Build run: sudo go build -o ./bin/tk ./cmd/tk - name: tk check --pre run: | ./bin/tk check --pre - name: tk install --version run: | ./bin/tk install --version=master --namespace=test --verbose --components="source-controller,kustomize-controller" - name: tk uninstall run: | ./bin/tk uninstall --namespace=test --crds --silent - name: tk install --manifests run: | ./bin/tk install --manifests ./manifests/install/ --version="" - name: tk create source git run: | ./bin/tk create source git podinfo \ --url https://github.com/stefanprodan/podinfo \ --tag-semver=">=3.2.3" - name: tk get sources git run: | ./bin/tk get sources git - name: tk create kustomization run: | ./bin/tk create kustomization podinfo \ --source=podinfo \ --path="./deploy/overlays/dev" \ --prune=true \ --interval=5m \ --validation=client \ --health-check="Deployment/frontend.dev" \ --health-check="Deployment/backend.dev" \ --health-check-timeout=3m - name: tk sync kustomization --with-source run: | ./bin/tk reconcile kustomization podinfo --with-source - name: tk get kustomizations run: | ./bin/tk get kustomizations - name: tk suspend kustomization run: | ./bin/tk suspend kustomization podinfo - name: tk resume kustomization run: | ./bin/tk resume kustomization podinfo - name: tk export run: | ./bin/tk export source git --all ./bin/tk export kustomization --all - name: tk delete kustomization run: | ./bin/tk delete kustomization podinfo --silent - name: tk delete source git run: | ./bin/tk delete source git podinfo --silent - name: tk create source helm run: | ./bin/tk create source helm podinfo \ --url https://stefanprodan.github.io/podinfo - name: tk create hr run: | ./bin/tk create hr podinfo \ --target-namespace=default \ --source=podinfo \ --chart-name=podinfo \ --chart-version=">4.0.0 <5.0.0" - name: tk delete hr run: | ./bin/tk delete hr podinfo --silent - name: tk check run: | ./bin/tk check - name: Debug failure if: failure() run: | kubectl version --client --short kubectl -n gitops-system get all kubectl -n gitops-system get kustomizations -oyaml kubectl -n gitops-system logs deploy/source-controller kubectl -n gitops-system logs deploy/kustomize-controller