Skip to content

Commit

Permalink
Merge pull request #17 from MidraLab/feat/workflow-automocgen
Browse files Browse the repository at this point in the history
mockgenのCI化
  • Loading branch information
eiei114 authored Nov 4, 2023
2 parents a25cfe9 + 7a987e3 commit a9bb610
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/auto_mockgen.yml
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 }}
81 changes: 81 additions & 0 deletions app/mocks/auth_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions app/mocks/handler_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 127 additions & 0 deletions app/mocks/user_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9bb610

Please sign in to comment.