-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add manifests and codegen validation in pull request
Signed-off-by: Abhinandan Purkait <[email protected]>
- Loading branch information
1 parent
5b13ad9
commit 3a22b81
Showing
7 changed files
with
140 additions
and
11 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 |
---|---|---|
|
@@ -35,12 +35,50 @@ jobs: | |
run: | | ||
ct lint --config ct.yaml | ||
validate_codegen: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: ${{ github.workspace }}/go | ||
GOBIN: ${{ github.workspace }}/go/bin | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Helm tool installer | ||
uses: Azure/[email protected] | ||
|
||
- name: Verify kubegen | ||
run: | | ||
make verify-kubegen | ||
- name: Verify manifests | ||
run: | | ||
make verify-manifests | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "validate_codegen"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Unit test | ||
run: make test | ||
|
||
|
@@ -111,7 +149,7 @@ jobs: | |
|
||
csi-driver: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "bdd-tests"] | ||
needs: ["bdd-tests"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ jobs: | |
- uses: rrbutani/[email protected] | ||
with: | ||
file: shell.nix | ||
|
||
- name: Check if the chart follows a valid semver version | ||
run: | | ||
branch_name="${{ github.event.pull_request.base.ref }}" | ||
|
@@ -42,12 +43,50 @@ jobs: | |
run: | | ||
ct lint --config ct.yaml | ||
validate_codegen: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: ${{ github.workspace }}/go | ||
GOBIN: ${{ github.workspace }}/go/bin | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Helm tool installer | ||
uses: Azure/[email protected] | ||
|
||
- name: Verify kubegen | ||
run: | | ||
make verify-kubegen | ||
- name: Verify manifests | ||
run: | | ||
make verify-manifests | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "validate_codegen"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Unit test | ||
run: make test | ||
|
||
|
@@ -118,7 +157,7 @@ jobs: | |
|
||
csi-driver: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "bdd-tests"] | ||
needs: ["bdd-tests"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
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 |
---|---|---|
|
@@ -28,12 +28,50 @@ jobs: | |
run: | | ||
ct lint --config ct.yaml | ||
validate_codegen: | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: ${{ github.workspace }}/go | ||
GOBIN: ${{ github.workspace }}/go/bin | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Helm tool installer | ||
uses: Azure/[email protected] | ||
|
||
- name: Verify kubegen | ||
run: | | ||
make verify-kubegen | ||
- name: Verify manifests | ||
run: | | ||
make verify-manifests | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "validate_codegen"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19.9 | ||
cache: false | ||
|
||
- name: Unit test | ||
run: make test | ||
|
||
|
@@ -104,7 +142,7 @@ jobs: | |
|
||
csi-driver: | ||
runs-on: ubuntu-latest | ||
needs: ["lint", "bdd-tests"] | ||
needs: ["bdd-tests"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
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 |
---|---|---|
|
@@ -125,7 +125,7 @@ bootstrap: controller-gen | |
|
||
.PHONY: controller-gen | ||
controller-gen: | ||
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go install -mod=mod sigs.k8s.io/controller-tools/cmd/[email protected] && rm -rf $$TMP_DIR; | ||
@go install -mod=mod sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# SRC_PKG is the path of code files | ||
SRC_PKG := github.com/openebs/zfs-localpv/pkg | ||
|
@@ -144,7 +144,7 @@ kubegendelete: | |
|
||
.PHONY: deepcopy-install | ||
deepcopy-install: | ||
@go install -mod=mod k8s.io/code-generator/cmd/deepcopy-gen | ||
@go install -mod=mod k8s.io/code-generator/cmd/deepcopy-gen@v0.27.2 | ||
|
||
.PHONY: deepcopy | ||
deepcopy: | ||
|
@@ -156,7 +156,7 @@ deepcopy: | |
|
||
.PHONY: clientset-install | ||
clientset-install: | ||
@go install -mod=mod k8s.io/code-generator/cmd/client-gen | ||
@go install -mod=mod k8s.io/code-generator/cmd/client-gen@v0.27.2 | ||
|
||
.PHONY: clientset | ||
clientset: | ||
|
@@ -170,7 +170,7 @@ clientset: | |
|
||
.PHONY: lister-install | ||
lister-install: | ||
@go install -mod=mod k8s.io/code-generator/cmd/lister-gen | ||
@go install -mod=mod k8s.io/code-generator/cmd/lister-gen@v0.27.2 | ||
|
||
.PHONY: lister | ||
lister: | ||
|
@@ -182,7 +182,7 @@ lister: | |
|
||
.PHONY: informer-install | ||
informer-install: | ||
@go install -mod=mod k8s.io/code-generator/cmd/informer-gen | ||
@go install -mod=mod k8s.io/code-generator/cmd/informer-gen@v0.27.2 | ||
|
||
.PHONY: informer | ||
informer: | ||
|
@@ -236,4 +236,14 @@ golint: | |
@echo "--------------------------------" | ||
@echo "" | ||
|
||
.PHONY: verify-manifests | ||
verify-manifests: bootstrap manifests | ||
@./buildscripts/check-diff.sh | ||
@echo "Completed verify-manifests no changes detected !!" | ||
|
||
.PHONY: verify-kubegen | ||
verify-kubegen: bootstrap kubegen | ||
@./buildscripts/check-diff.sh | ||
@echo "Completed verify-codegen no changes detected !!" | ||
|
||
include Makefile.buildx.mk |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
git --no-pager diff --exit-code pkg/generated pkg/apis/ deploy/yamls |
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 |
---|---|---|
|
@@ -118,4 +118,3 @@ then | |
# Push COMMIT tagged image - :COMMIT | ||
TagAndPushImage "${DIMAGE}" "${COMMIT}" | ||
fi; | ||
|