diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml new file mode 100644 index 000000000..740ed0f3d --- /dev/null +++ b/.github/workflows/codegen.yml @@ -0,0 +1,20 @@ +name: Codegen +on: [pull_request] + +jobs: + codegen: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + + - uses: actions/setup-go@v2 + with: + go-version: 1.13 + + - name: run codegen + run: GOPATH=$(go env GOPATH) make codegen + + - name: validate codegen + run: hack/validate-codegen.sh + diff --git a/hack/validate-codegen.sh b/hack/validate-codegen.sh new file mode 100755 index 000000000..e7b1e7bab --- /dev/null +++ b/hack/validate-codegen.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -ex + +for file in $(git status --porcelain); do + if [[ "$file" =~ "zz" ]]; then + echo "found codegen files!" + echo "please run 'make codegen' and update your PR" + exit 1 + fi +done