-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add GitHub Action for go mod tidy and mocks
- Loading branch information
1 parent
46d6406
commit 7bed202
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
name: 'PR Go Mod Tidy and Mocks' | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }}-pr-go-mod-tidy-mocks | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
go-mod-tidy: | ||
name: Check go mod tidy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 'stable' | ||
- name: Run go mod tidy | ||
run: ./scripts/go-mod-tidy-all.sh | ||
- name: Check for diffs | ||
run: | | ||
git diff --exit-code || { | ||
echo "Please run './scripts/go-mod-tidy-all.sh' and commit the changes"; | ||
exit 1; | ||
} | ||
generate-mocks: | ||
name: Generate Mocks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 'stable' | ||
- name: Generate mocks | ||
run: make mocks | ||
- name: Check for diffs | ||
run: | | ||
git diff --exit-code || { | ||
echo "Please run 'make mocks' and commit the changes"; | ||
exit 1; | ||
} |