name: "make-gen-delta" on: - workflow_dispatch - push - workflow_call permissions: contents: read jobs: make-gen-delta: name: "Check for uncommitted changes from make gen" runs-on: ${{ fromJSON(vars.RUNNER) }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: '0' - name: Determine Go version id: get-go-version # We use .go-version as our source of truth for current Go # version, because "goenv" can react to it automatically. run: | echo "Building with Go $(cat .go-version)" echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - name: Set up Go uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 with: go-version: "${{ steps.get-go-version.outputs.go-version }}" cache: false - name: Determine Go cache paths id: go-cache-paths run: | echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" echo "go-bin=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT" - name: Set up Go modules cache uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.3 with: path: | ${{ steps.go-cache-paths.outputs.go-mod }} key: go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | go-mod - name: Set up Go tools cache id: go-tools-cache uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.3 with: path: | ${{ steps.go-cache-paths.outputs.go-bin }} key: go-tools-${{ steps.get-go-version.outputs.go-version }}-${{ hashFiles('**/go.sum', './Makefile', './tools/tools.go') }} restore-keys: | go-tools-${{ steps.get-go-version.outputs.go-version }} - name: Running go mod tidy run: | go mod tidy - name: Install Dependencies if: steps.go-tools-cache.outputs.cache-hit != 'true' run: | go mod download make tools - name: Running make gen run: | make gen - name: Check for changes run: | git diff --exit-code git status --porcelain test -z "$(git status --porcelain)"