diff --git a/.github/conflint.yaml b/.github/conflint.yaml new file mode 100644 index 0000000000..d815c5fa34 --- /dev/null +++ b/.github/conflint.yaml @@ -0,0 +1,5 @@ +kubeval: + - files: + - k8s/**/*.yaml + strict: true + ignoreMissingSchemas: true diff --git a/.github/kubelinter.yaml b/.github/kubelinter.yaml new file mode 100644 index 0000000000..0afaa412bd --- /dev/null +++ b/.github/kubelinter.yaml @@ -0,0 +1,5 @@ +checks: + addAllBuildIn: true + exclude: + - "unset-cpu-requirements" + - "unset-memory-requirements" diff --git a/.github/workflows/reviewdog-k8s.yml b/.github/workflows/reviewdog-k8s.yml new file mode 100644 index 0000000000..e18482a914 --- /dev/null +++ b/.github/workflows/reviewdog-k8s.yml @@ -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