You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flux2/.github/workflows/e2e.yaml

153 lines
5.1 KiB
YAML

name: e2e
on:
pull_request:
push:
branches:
- main
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
with:
go-version: 1.15.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/gotk ./cmd/gotk
- name: gotk check --pre
run: |
./bin/gotk check --pre
- name: gotk install --manifests
run: |
./bin/gotk install --manifests ./manifests/install/
- name: gotk create source git
run: |
./bin/gotk create source git podinfo \
--url https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.3"
- name: gotk create source git export apply
run: |
./bin/gotk create source git podinfo-export \
--url https://github.com/stefanprodan/podinfo \
--tag-semver=">=3.2.3" \
--export | kubectl apply -f -
./bin/gotk delete source git podinfo-export --silent
- name: gotk get sources git
run: |
./bin/gotk get sources git
- name: gotk get sources git --all-namespaces
run: |
./bin/gotk get sources git --all-namespaces
- name: gotk create kustomization
run: |
./bin/gotk 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: gotk reconcile kustomization --with-source
run: |
./bin/gotk reconcile kustomization podinfo --with-source
- name: gotk get kustomizations
run: |
./bin/gotk get kustomizations
- name: gotk get kustomizations --all-namespaces
run: |
./bin/gotk get kustomizations --all-namespaces
- name: gotk suspend kustomization
run: |
./bin/gotk suspend kustomization podinfo
- name: gotk resume kustomization
run: |
./bin/gotk resume kustomization podinfo
- name: gotk export
run: |
./bin/gotk export source git --all
./bin/gotk export kustomization --all
- name: gotk delete kustomization
run: |
./bin/gotk delete kustomization podinfo --silent
- name: gotk create source helm
run: |
./bin/gotk create source helm podinfo \
--url https://stefanprodan.github.io/podinfo
- name: gotk create helmrelease --source=HelmRepository/podinfo
run: |
./bin/gotk create hr podinfo-helm \
--target-namespace=default \
--source=HelmRepository/podinfo \
--chart=podinfo \
--chart-version=">4.0.0 <5.0.0"
- name: gotk create helmrelease --source=GitRepository/podinfo
run: |
./bin/gotk create hr podinfo-git \
--target-namespace=default \
--source=GitRepository/podinfo \
--chart=./charts/podinfo
- name: gotk reconcile helmrelease --with-source
run: |
./bin/gotk reconcile helmrelease podinfo-git --with-source
- name: gotk get helmreleases
run: |
./bin/gotk get helmreleases
- name: gotk get helmreleases --all-namespaces
run: |
./bin/gotk get helmreleases --all-namespaces
- name: gotk export helmrelease
run: |
./bin/gotk export hr --all
- name: gotk delete helmrelease podinfo-helm
run: |
./bin/gotk delete hr podinfo-helm --silent
- name: gotk delete helmrelease podinfo-git
run: |
./bin/gotk delete hr podinfo-git --silent
- name: gotk delete source helm
run: |
./bin/gotk delete source helm podinfo --silent
- name: gotk delete source git
run: |
./bin/gotk delete source git podinfo --silent
- name: gotk check
run: |
./bin/gotk check
- name: gotk uninstall
run: |
./bin/gotk uninstall --crds --silent
- name: Debug failure
if: failure()
run: |
kubectl version --client --short
kubectl -n flux-system get all
kubectl -n flux-system get kustomizations -oyaml
kubectl -n flux-system logs deploy/source-controller
kubectl -n flux-system logs deploy/kustomize-controller