mirror of
https://github.com/stulzq/azure-openai-proxy.git
synced 2025-12-19 15:24:24 +01:00
chore: add code check
This commit is contained in:
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -29,5 +29,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache: false
|
cache: false
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
|
- name: Verify gofmt
|
||||||
|
run: |
|
||||||
|
make fmt && git add azure util cmd constant &&
|
||||||
|
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
|
||||||
|
- name: Verify govet
|
||||||
|
run: |
|
||||||
|
make vet && git add azure util cmd constant &&
|
||||||
|
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make build
|
run: make build
|
||||||
8
Makefile
8
Makefile
@@ -4,4 +4,10 @@ BIN_NAME := "azure-openai-proxy"
|
|||||||
build:
|
build:
|
||||||
@env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BIN_NAME) ./cmd
|
@env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BIN_NAME) ./cmd
|
||||||
|
|
||||||
.PHONY: build
|
fmt:
|
||||||
|
go fmt ./...
|
||||||
|
|
||||||
|
vet:
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
|
.PHONY: build fmt vet
|
||||||
@@ -45,7 +45,7 @@ func runServer(srv *http.Server) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
quit := make(chan os.Signal)
|
quit := make(chan os.Signal, 1)
|
||||||
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
||||||
<-quit
|
<-quit
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user