From 81fe442bf44923f49ce08ecc3dd5bded57dad974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 11 Sep 2023 23:32:38 +0200 Subject: [PATCH] chore: check test files are up to date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2687d026b..2f38b9789 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,4 +89,34 @@ jobs: - name: Test Policy run: go run ./cmd/cli/kubectl-kyverno test ../policies - working-directory: kyverno \ No newline at end of file + working-directory: kyverno + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + with: + path: policies + - name: Clone Kyverno + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + with: + repository: kyverno/kyverno + path: kyverno + # The target branch of a pull request or the branch/tag of a push + ref: ${{ github.base_ref || github.ref_name }} + - name: Set up Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version: "1.20" + - name: Lint policies + run: | + set -e + KYVERNO_EXPERIMENTAL=true go run ./cmd/cli/kubectl-kyverno fix test . --save + working-directory: kyverno + - name: Check diff + run: | + set -e + git --no-pager diff test/cli + git diff --quiet --exit-code test/cli + working-directory: policies \ No newline at end of file