From c303defcf4ac1df4d67bd8e16148da4d1b17ad4e Mon Sep 17 00:00:00 2001 From: Andreas Fritzler Date: Wed, 13 Apr 2022 21:35:06 +0200 Subject: [PATCH] Add codegen check workflow (#347) Make sure that the generated clients are up to date. --- .github/workflows/check-codegen.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/check-codegen.yml diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml new file mode 100644 index 000000000..8dc58e650 --- /dev/null +++ b/.github/workflows/check-codegen.yml @@ -0,0 +1,26 @@ +name: Check Codegen + +on: + pull_request: + paths-ignore: + - 'docs/**' + - '**/*.md' + +jobs: + check-codegen: + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v2 + with: + go-version: '1.17' + - name: Run make generate + run: make generate + - name: Compare the expected and actual generated/* directories + run: | + if [ "$(git diff --ignore-space-at-eol generated/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. Consider running 'make generate'." + echo "See status below:" + git diff + exit 1 + fi