-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add github action to check diffs on generated bits
For now, we're checking the diff of: go mod tidy make fmt
- Loading branch information
Showing
6 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
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@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: "${{ steps.get-go-version.outputs.go-version }}" | ||
- name: Running go mod tidy | ||
run: | | ||
go mod tidy | ||
- name: Install Dependencies | ||
run: | | ||
make tools | ||
- name: Running make fmt | ||
run: | | ||
make fmt | ||
- name: Check for changes | ||
run: | | ||
git diff --exit-code | ||
git status --porcelain | ||
test -z "$(git status --porcelain)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
//go:build tools | ||
// +build tools | ||
|
||
// This file ensures tool dependencies are kept in sync. This is the | ||
// recommended way of doing this according to | ||
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module | ||
// To install the following tools at the version used by this repo run: | ||
// $ make tools | ||
// or | ||
// $ go generate -tags tools tools/tools.go | ||
|
||
package tools | ||
|
||
// NOTE: This must not be indented, so to stop goimports from trying to be | ||
// helpful, it's separated out from the import block below. Please try to keep | ||
// them in the same order. | ||
//go:generate go install mvdan.cc/gofumpt | ||
|
||
import ( | ||
_ "mvdan.cc/gofumpt" | ||
) |