-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maintenance] Add CircleCI workflow to verify manifests - GT-493 (#1431)
- Loading branch information
1 parent
73d56f0
commit ff34073
Showing
5 changed files
with
207 additions
and
66 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 |
---|---|---|
@@ -1,71 +1,17 @@ | ||
version: 2.1 | ||
orbs: | ||
slack: circleci/[email protected] | ||
|
||
executors: | ||
golang-executor: | ||
docker: | ||
- image: gcr.io/gcr-for-testing/golang:1.20.8 | ||
orbs: | ||
path-filtering: circleci/[email protected] | ||
|
||
jobs: | ||
check-code: | ||
executor: golang-executor | ||
steps: | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- checkout | ||
- run: | ||
name: Install deps | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
make vendor | ||
make tools-min | ||
exit 0 | ||
fi | ||
apt-get update | ||
apt-get install -y unzip | ||
make init | ||
- run: | ||
name: License check | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make license-verify license-range-verify | ||
- run: make fmt-verify | ||
- run: make linter | ||
- run: | ||
name: Unit tests | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make run-unit-tests | ||
- run: | ||
name: make bin | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make bin | ||
- run: | ||
name: vulncheck | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make vulncheck | ||
environment: | ||
GO111MODULES: off | ||
setup: true | ||
|
||
workflows: | ||
version: 2 | ||
|
||
# Default workflow | ||
run_tests: | ||
always-run: | ||
jobs: | ||
- check-code | ||
- path-filtering/filter: | ||
name: check-updated-files | ||
base-revision: master | ||
config-path: .circleci/continue_config.yml | ||
mapping: | | ||
manifests/.* manifests-verify true | ||
chart/.* manifests-verify true |
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,118 @@ | ||
version: 2.1 | ||
orbs: | ||
slack: circleci/[email protected] | ||
|
||
parameters: | ||
manifests-verify: | ||
type: boolean | ||
default: false | ||
minikube-version: | ||
type: string | ||
default: v1.31.2 | ||
helm-version: | ||
type: string | ||
default: v3.13.0 | ||
|
||
executors: | ||
golang-executor: | ||
docker: | ||
- image: gcr.io/gcr-for-testing/golang:1.20.8 | ||
machine-executor: | ||
machine: | ||
image: ubuntu-2204:current | ||
docker_layer_caching: true | ||
|
||
jobs: | ||
check-code: | ||
executor: golang-executor | ||
steps: | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- checkout | ||
- run: | ||
name: Install deps | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
make vendor | ||
make tools-min | ||
exit 0 | ||
fi | ||
apt-get update | ||
apt-get install -y unzip | ||
make init | ||
- run: | ||
name: License check | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make license-verify license-range-verify | ||
- run: make fmt-verify | ||
- run: make linter | ||
- run: | ||
name: Unit tests | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make run-unit-tests | ||
- run: | ||
name: make bin | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make bin | ||
- run: | ||
name: vulncheck | ||
command: | | ||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then | ||
echo "This is not a pull request. Skipping..." | ||
exit 0 | ||
fi | ||
make vulncheck | ||
environment: | ||
GO111MODULES: off | ||
|
||
manifests_verify: | ||
executor: machine-executor | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Kubectl Executable | ||
command: |- | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && | ||
chmod +x kubectl && | ||
sudo mv kubectl /usr/local/bin/ | ||
mkdir -p ${HOME}/.kube && touch ${HOME}/.kube/config | ||
- run: | ||
name: Install Minikube Executable | ||
command: |- | ||
curl -Lo minikube https://github.com/kubernetes/minikube/releases/download/<< pipeline.parameters.minikube-version >>/minikube-linux-amd64 && | ||
chmod +x minikube && | ||
sudo mv minikube /usr/local/bin/ | ||
- run: | ||
name: Install Helm Service | ||
command: |- | ||
export DESIRED_VERSION=<< pipeline.parameters.helm-version >> | ||
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash | ||
- run: | ||
command: make manifests | ||
- run: | ||
command: make manifests-verify | ||
|
||
workflows: | ||
version: 2 | ||
|
||
run_tests: | ||
jobs: | ||
- check-code | ||
|
||
manifests-verify: | ||
when: | ||
equal: [ true, << pipeline.parameters.manifests-verify >> ] | ||
jobs: | ||
- manifests_verify |
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ deps/ | |
enterprise.mk | ||
license-header.enterprise.txt | ||
local/ | ||
kustomize_test/ | ||
tools/codegen/boilerplate.go.txt |
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,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- enterprise-k2kclustersync.yaml |