Skip to content

Commit

Permalink
Merge pull request #1 from rancher-sandbox/add-openapi-specs
Browse files Browse the repository at this point in the history
Add openapi specs
  • Loading branch information
anmazzotti authored Sep 25, 2023
2 parents 6d71009 + a559149 commit cca0d52
Show file tree
Hide file tree
Showing 11 changed files with 685 additions and 37 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Verify
on:
pull_request:
push:
branches:
- main
tags:
- 'v*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Run verify checks
run: make verify
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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: openapi
openapi: ## Generate Elemental OpenAPI specs
go test -v -run ^TestGenerateOpenAPI$

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
Expand Down Expand Up @@ -209,3 +213,29 @@ lint: ## See: https://golangci-lint.run/usage/linters/
-E tagliatelle \
-E revive \
-E wrapcheck

ALL_VERIFY_CHECKS = manifests generate openapi

.PHONY: verify
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS))

.PHONY: verify-manifests
verify-manifests: manifests
@if !(git diff --quiet HEAD); then \
git diff; \
echo "generated files are out of date, run make generate"; exit 1; \
fi

.PHONY: verify-openapi
verify-openapi: openapi
@if !(git diff --quiet HEAD); then \
git diff; \
echo "generated files are out of date, run make generate"; exit 1; \
fi

.PHONY: verify-generate
verify-generate: generate
@if !(git diff --quiet HEAD); then \
git diff; \
echo "generated files are out of date, run make generate"; exit 1; \
fi
Loading

0 comments on commit cca0d52

Please sign in to comment.