diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 0000000..a6bca1f --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,29 @@ +on: + pull_request: + paths-ignore: + - "**/*.md" + - "CODEOWNERS" + push: + paths-ignore: + - "**/*.md" + - "CODEOWNERS" + branches: + - "main" + +jobs: + e2e-k8s: + name: "e2e-k8s" + runs-on: "ubuntu-20.04" + strategy: + fail-fast: false + matrix: + kubernetes_versions: ["1.24", "1.23", "1.22"] + env: + KUBERNETES_VERSION: ${{ matrix.kubernetes_versions }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: "1.19" + - run: make -C e2e create-cluster + - run: make -C e2e test diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml new file mode 100644 index 0000000..ec99098 --- /dev/null +++ b/.github/workflows/helm.yaml @@ -0,0 +1,36 @@ +name: "Lint Charts" + +on: + pull_request: + paths: + - "charts/**" + - "ct.yaml" + +jobs: + lint: + runs-on: "ubuntu-20.04" + + steps: + - name: "Checkout" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Setup Go" + uses: actions/setup-go@v3 + with: + go-version: "1.19" + + - name: "Set up chart-testing" + uses: helm/chart-testing-action@v2.3.1 + + - name: "Run chart-testing (list-changed)" + id: list-changed + run: | + changed=$(ct list-changed --config ct.yaml) + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + fi + + - name: "Run chart-testing (lint)" + run: ct lint --config ct.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..965f545 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,18 @@ +name: "Main" +on: + pull_request: + push: + branches: + - "main" +jobs: + build: + name: "build" + runs-on: "ubuntu-20.04" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: "1.19" + - run: make check-uncommitted + - run: make test + - run: make docker-build diff --git a/Makefile b/Makefile index 030b49b..60fce18 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,10 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." +.PHONY: check-uncommitted +check-uncommitted: manifests generate ## Check if latest generated artifacts are committed. + git diff --exit-code --name-only + .PHONY: fmt fmt: ## Run go fmt against code. go fmt ./... diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 0000000..2450f0a --- /dev/null +++ b/ct.yaml @@ -0,0 +1,4 @@ +# This file is the config file for helm/chart-testing +target-branch: main +validate-maintainers: false +check-version-increment: false