Skip to content

Commit

Permalink
feat(ci): add tidy check
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Jun 21, 2024
1 parent ea1ff3f commit 1a42eb6
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,35 @@ on:
type: string

jobs:
tidy:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Checkout code
uses: actions/checkout@v4

- name: go mod tidy
working-directory: ${{ inputs.modulepath }}
run: go mod tidy -v

- name: Check git diff
run: git diff --exit-code || (echo 'go mod tidy has made changes'; exit 1)

generated:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Checkout code
uses: actions/checkout@v4

- name: Check generated files are up to date
working-directory: ${{ inputs.modulepath }}
run: |
Expand Down

0 comments on commit 1a42eb6

Please sign in to comment.