Skip to content

Commit

Permalink
add check to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
day253 committed Oct 19, 2024
1 parent 7bff706 commit fb6fe07
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
go-version: '1.19'

- name: Test
run: make action
run: make build
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.19 AS builder

WORKDIR /mnt/engine

COPY . .

RUN make build

FROM golang:1.19

WORKDIR /mnt/engine

COPY --from=builder /mnt/engine/build .

CMD ["./bin/boilerplate"]
15 changes: 7 additions & 8 deletions Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ OUTDIR := $(HOMEDIR)/build
BINDIR := $(OUTDIR)/bin
GO := go
GOPATH := $(shell $(GO) env GOPATH)

GOBIN := $(GOPATH)/bin

.PHONY: all
all: prepare compile test package

.PHONY: build-in-docker
build-in-docker: prepare compile package
all: prepare compile check test package

.PHONY: action
action: prepare compile
.PHONY: build
build: prepare compile check package

.PHONY: prepare
prepare: prepare-dep
Expand Down Expand Up @@ -77,7 +73,10 @@ coverage: set-env
$(GO) tool cover -html=coverage.cov -o coverage.html

.PHONY: check
check: golangci-lint
check: check-tools golangci-lint

.PHONY: fix
fix: check-tools golangci-lint-fix

check-tools: set-env
$(GO) install -v "github.com/golangci/golangci-lint/cmd/[email protected]"
Expand Down
11 changes: 0 additions & 11 deletions boilerplate/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions boilerplate/dist/bin/build.sh

This file was deleted.

14 changes: 0 additions & 14 deletions boilerplate/dist/bin/docker-start.sh

This file was deleted.

9 changes: 0 additions & 9 deletions boilerplate/dist/bin/start.sh

This file was deleted.

1 change: 1 addition & 0 deletions protocols/arbiter/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"

service "github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service"
)

Expand Down
3 changes: 2 additions & 1 deletion protocols/arbiter/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
service "github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
"log"

service "github.com/ishumei/krpc/protocols/arbiter/kitex_gen/com/shumei/service/predictor"
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions protocols/audio/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"

re "github.com/ishumei/krpc/protocols/audio/kitex_gen/shumei/strategy/re"
)

Expand Down
3 changes: 2 additions & 1 deletion protocols/audio/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
re "github.com/ishumei/krpc/protocols/audio/kitex_gen/shumei/strategy/re/audiopredictor"
"log"

re "github.com/ishumei/krpc/protocols/audio/kitex_gen/shumei/strategy/re/audiopredictor"
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions protocols/event/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"

re "github.com/ishumei/krpc/protocols/event/kitex_gen/shumei/strategy/re"
)

Expand Down
3 changes: 2 additions & 1 deletion protocols/event/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
re "github.com/ishumei/krpc/protocols/event/kitex_gen/shumei/strategy/re/eventpredictor"
"log"

re "github.com/ishumei/krpc/protocols/event/kitex_gen/shumei/strategy/re/eventpredictor"
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions protocols/image/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"

re "github.com/ishumei/krpc/protocols/image/kitex_gen/shumei/strategy/re"
)

Expand Down
3 changes: 2 additions & 1 deletion protocols/image/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
re "github.com/ishumei/krpc/protocols/image/kitex_gen/shumei/strategy/re/imagepredictor"
"log"

re "github.com/ishumei/krpc/protocols/image/kitex_gen/shumei/strategy/re/imagepredictor"
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions protocols/text/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"

re "github.com/ishumei/krpc/protocols/text/kitex_gen/shumei/strategy/re"
)

Expand Down
3 changes: 2 additions & 1 deletion protocols/text/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
re "github.com/ishumei/krpc/protocols/text/kitex_gen/shumei/strategy/re/textpredictor"
"log"

re "github.com/ishumei/krpc/protocols/text/kitex_gen/shumei/strategy/re/textpredictor"
)

func main() {
Expand Down

0 comments on commit fb6fe07

Please sign in to comment.