Skip to content

Commit

Permalink
CI: Add reviewdog-k8s (#824)
Browse files Browse the repository at this point in the history
* 💚 Add kubeval-conflint

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

* ✨ add kubelinter

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

* 🔧 add some exclude rules

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Nov 10, 2020
1 parent baeb365 commit 27b5a16
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/conflint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kubeval:
- files:
- k8s/**/*.yaml
strict: true
ignoreMissingSchemas: true
5 changes: 5 additions & 0 deletions .github/kubelinter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
checks:
addAllBuildIn: true
exclude:
- "unset-cpu-requirements"
- "unset-memory-requirements"
52 changes: 52 additions & 0 deletions .github/workflows/reviewdog-k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Copyright (C) 2019-2020 Vdaas.org Vald team ( kpango, rinx, kmrmt )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: "reviewdog - K8s manifests"
on:
pull_request:
paths:
- "k8s/**"

jobs:
kubeval-conflint:
name: runner / kubeval-conflint
runs-on: ubuntu-latest
container: mumoshu/conflint:latest
steps:
- uses: actions/checkout@v2
- name: kubeval-conflint
run: |
set -vx
conflint run -c .github/conflint.yaml -efm "%f:%l:%c: %m" || true
conflint run -c .github/conflint.yaml -efm "%f:%l:%c: %m" | reviewdog -efm="%f:%l:%c: %m" -reporter=${REPORTER} -tee
env:
CONFLINT_LOG: DEBUG
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPORTER: github-pr-review
kubelinter:
name: runner / kubelinter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup-kubelinter
run: |
wget https://github.com/stackrox/kube-linter/releases/download/${KUBELINTER_VERSION}/kube-linter-linux.zip
unzip kube-linter-linux.zip
env:
KUBELINTER_VERSION: 0.1.2
- name: kubelinter
run: |
./kube-linter lint --config .github/kubelinter.yaml k8s

0 comments on commit 27b5a16

Please sign in to comment.