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

ci: Add GitHub Action for go mod tidy and mocks #20501

Merged
merged 4 commits into from
May 31, 2024
Merged
Changes from 1 commit
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
48 changes: 48 additions & 0 deletions .github/workflows/pr-go-mod-tidy-mocks.yml
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
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
- 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
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
- 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;
}
Loading