Skip to content

Commit

Permalink
add github workflows for CI
Browse files Browse the repository at this point in the history
Signed-off-by: Yuma Ogami <[email protected]>
Co-authored-by: Shinya Hayashi <[email protected]>
  • Loading branch information
cupnes and peng225 committed Oct 20, 2022
1 parent cd8ba5c commit 8864db2
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- 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
18 changes: 18 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down
4 changes: 4 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is the config file for helm/chart-testing
target-branch: main
validate-maintainers: false
check-version-increment: false

0 comments on commit 8864db2

Please sign in to comment.