From 7d0203196a098f019578eb937cbd28b23481e025 Mon Sep 17 00:00:00 2001 From: Piaras Hoban Date: Mon, 11 Apr 2022 10:51:15 +0100 Subject: [PATCH] cue: add cue format and validation checks to github actions test workflow Signed-off-by: Piaras Hoban --- .github/workflows/test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f69560..72e506a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,3 +45,19 @@ jobs: command: | kustomize build ./kustomize | kubeval --strict --kubernetes-version 1.19.11 --schema-location https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master kustomize build ./kustomize | conftest test -p .github/policy - + - name: Setup CUE + uses: cue-lang/setup-cue@main + - name: Verify CUE formatting + working-directory: ./cue + run: | + cue fmt . + status=$(git status --porcelain) + [[ -z "$status" ]] || { + echo "CUE files are not correctly formatted" + echo "$status" + git diff + exit 1 + } + - name: Validate CUE + working-directory: ./cue + run: cue vet --all-errors --concrete .