-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from MidraLab/feat/workflow-automocgen
mockgenのCI化
- Loading branch information
Showing
5 changed files
with
491 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,45 @@ | ||
name: Generate Mocks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21.1 | ||
|
||
- name: Install mockgen | ||
run: go install go.uber.org/mock/mockgen@latest | ||
|
||
- name: Generate mocks | ||
run: | | ||
cd app | ||
go generate ./... | ||
- name: Configure Git | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
- name: Get the current branch name | ||
id: get-branch-name | ||
run: echo "::set-output name=branch::$(echo ${GITHUB_HEAD_REF})" | ||
|
||
- name: Commit and push generated tests | ||
run: | | ||
git add -A | ||
git commit -m "Generate missing mocks [skip ci]" | ||
git push origin ${{ steps.get-branch-name.outputs.branch }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.