Skip to content

Commit b81902a

Browse files
authoredFeb 3, 2025
Merge pull request #86 from nao1215/nchika/reduce-dependency
Reduce dependency and add unit tests for interactor
2 parents 0532223 + 5a4bb96 commit b81902a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3829
-205
lines changed
 
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CheckAutoGenerateFiles
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
check_generate_file:
12+
name: Check auto generate files
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: "go.mod"
24+
cache-dependency-path: "go.sum"
25+
26+
- name: Install tools
27+
run: |
28+
go install go.uber.org/mock/mockgen@latest
29+
30+
- name: check go mod tidy
31+
run: |
32+
go mod tidy
33+
git diff --exit-code
34+
35+
- name: Check auto generate files
36+
run: |
37+
go generate ./...
38+
git diff --exit-code

‎Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build: ## Build binary
2222
env GO111MODULE=on CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD) $(GO_LDFLAGS) -o $(APP) main.go
2323

2424
clean: ## Clean project
25-
-rm -rf $(APP) cover.out cover.html
25+
-rm -rf $(APP) cover.*
2626

2727
test: ## Start test
2828
env GOOS=$(GOOS) $(GO_TEST) -cover $(GO_PKGROOT) -coverpkg=./... -coverprofile=cover.out
@@ -32,7 +32,8 @@ bench: ## Start benchmark
3232
env GOOS=$(GOOS) go test -bench=BenchmarkImport100000Records -benchmem
3333

3434
coverage-tree: test ## Generate coverage tree
35-
go-cover-treemap -statements -coverprofile cover.out > doc/img/cover-tree.svg
35+
grep -v 'github.com/nao1215/sqly/interactor/mock' cover.out | grep -v 'github.com/nao1215/sqly/infrastructure/mock' > cover.tmp
36+
go-cover-treemap -statements -percent -coverprofile cover.tmp > doc/img/cover-tree.svg
3637

3738
changelog: ## Generate changelog
3839
ghch --format markdown > CHANGELOG.md

0 commit comments

Comments
 (0)