-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mikenairn/add_gh_workflows_and_local_setup
Add local-setup and CI GH Workflow
- Loading branch information
Showing
8 changed files
with
208 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- "release-*" | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
paths-ignore: | ||
- '**.adoc' | ||
- '**.md' | ||
- 'samples/**' | ||
- 'LICENSE' | ||
pull_request: | ||
branches: | ||
- main | ||
- "release-*" | ||
paths-ignore: | ||
- '**.adoc' | ||
- '**.md' | ||
- 'samples/**' | ||
- 'LICENSE' | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: v1.21.x | ||
cache: false | ||
- uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.55.2 | ||
only-new-issues: true | ||
args: --timeout=5m | ||
verify-code: | ||
name: Verify code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.21.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
cache: false | ||
id: go | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Run make verify-code | ||
run: | | ||
make verify-code | ||
verify-manifests: | ||
name: Verify manifests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.21.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
cache: false | ||
id: go | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Run make verify-manifests | ||
run: | | ||
make verify-manifests | ||
verify-bundle: | ||
name: Verify bundle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.21.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
cache: false | ||
id: go | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Run make verify-bundle | ||
run: | | ||
make verify-bundle | ||
verify-imports: | ||
name: Verify imports | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.21.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
cache: false | ||
id: go | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Run make verify-manifests | ||
run: | | ||
make verify-imports | ||
unit_test_suite: | ||
name: Unit Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: v1.21 | ||
cache: false | ||
- name: Run suite | ||
run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# https://golangci-lint.run/usage/linters/ | ||
linters: | ||
enable: | ||
- gofmt | ||
- misspell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Local deployment overlay. | ||
# | ||
# Set the deployment imagePullPolicy to IfNotPresent. This is required if you are using a local image loaded into kind i.e. make kind-load-image | ||
# | ||
|
||
resources: | ||
- ../../default | ||
|
||
patchesStrategicMerge: | ||
- manager_config_patch.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
imagePullPolicy: IfNotPresent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.27.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
##@ Kind | ||
|
||
## Targets to help install and use kind for development https://kind.sigs.k8s.io | ||
|
||
KIND_CLUSTER_NAME ?= kuadrant-dns-local | ||
|
||
.PHONY: kind-create-cluster | ||
kind-create-cluster: kind ## Create the "kuadrant-dns-local" kind cluster. | ||
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config hack/kind-cluster.yaml | ||
|
||
.PHONY: kind-delete-cluster | ||
kind-delete-cluster: kind ## Delete the "kuadrant-dns-local" kind cluster. | ||
- $(KIND) delete cluster --name $(KIND_CLUSTER_NAME) | ||
|
||
.PHONY: kind-load-image | ||
kind-load-image: kind ## Load image to "kuadrant-dns-local" kind cluster. | ||
$(KIND) load docker-image $(IMG) --name $(KIND_CLUSTER_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
##@ Verify | ||
|
||
## Targets to verify actions that generate/modify code have been executed and output committed | ||
|
||
.PHONY: verify-code | ||
verify-code: vet ## Verify code formatting | ||
@diff -u <(echo -n) <(gofmt -s -d `find . -type f -name '*.go' -not -path "./vendor/*"`) | ||
|
||
.PHONY: verify-manifests | ||
verify-manifests: manifests ## Verify manifests update. | ||
git diff --exit-code ./config | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./config)" ] | ||
|
||
.PHONY: verify-bundle | ||
verify-bundle: bundle ## Verify bundle update. | ||
git diff --exit-code ./bundle | ||
[ -z "$$(git ls-files --other --exclude-standard --directory --no-empty-directory ./bundle)" ] | ||
|
||
.PHONY: verify-imports | ||
verify-imports: ## Verify go imports are sorted and grouped correctly. | ||
hack/verify-imports.sh |