Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for go mod inconsistencies #1368

Merged
merged 5 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- run: go version

- run: go mod tidy
- run: git diff --exit-code go.mod
- name: Error message
if: ${{ failure() }}
run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.'; echo '::error file=enterprise_mod.go,line=1,col=1::Possible missing enterprise exclusive dependencies.'

- run: make mocks
- run: git diff --exit-code
- name: Error message
if: ${{ failure() }}
run: echo '::error file=Makefile,line=11,col=1::Incorrectly generated files. Ensure you have run `make mocks` and committed the files locally.'

13 changes: 13 additions & 0 deletions enterprise_mod.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// +build enterprisemod

// This file contains enterprise exclusive dependencies.
// So that the go.mod file can be consistant regardless of enterprise code being present.
// To detect enterprise exclusive dependencies:
// 1. run `make enterprise-cleanup`
// 2. `go mod tidy`
// 3. observe the changes on go.mod `git diff go.mod`
package enterprisemod

import (
_ "github.com/spaolacci/murmur3"
)