diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ab6e7f9 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,17 @@ +name: Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.22" + + - name: Build + run: make build-only diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..810b145 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,19 @@ +name: Lint + +on: [push] + +jobs: + golangci: + name: golangci + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..26e796e --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,17 @@ +name: Test + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.22" + + - name: Test + run: make test-only race diff --git a/.github/workflows/vulncheck.yaml b/.github/workflows/vulncheck.yaml new file mode 100644 index 0000000..5be908f --- /dev/null +++ b/.github/workflows/vulncheck.yaml @@ -0,0 +1,20 @@ +name: Vulncheck + +on: [push] + +jobs: + vulncheck: + name: vulncheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - id: govulncheck + uses: golang/govulncheck-action@v1 + with: + go-version-input: "1.22" + go-package: ./... diff --git a/Makefile b/Makefile index ec02b45..38a3f98 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ lint: vulncheck: govulncheck ./... -build-only: build-service +build-only: build-service build-example-grpc-server build-service: CGO_ENABLED=0 GOOS=linux go build $(LDFLAGS) -o $(APP_NAME) ./cmd/service/ diff --git a/README.md b/README.md index f535fe7..6970564 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ # GRPC REST Proxy + +[![Build](https://github.com/eset/grpc-rest-proxy/actions/workflows/build.yaml/badge.svg)](https://github.com/eset/grpc-rest-proxy/actions/workflows/build.yaml) +[![Test](https://github.com/eset/grpc-rest-proxy/actions/workflows/test.yaml/badge.svg)](https://github.com/eset/grpc-rest-proxy/actions/workflows/test.yaml) +[![Lint](https://github.com/eset/grpc-rest-proxy/actions/workflows/lint.yaml/badge.svg)](https://github.com/eset/grpc-rest-proxy/actions/workflows/lint.yaml) +[![Vulncheck](https://github.com/eset/grpc-rest-proxy/actions/workflows/vulncheck.yaml/badge.svg)](https://github.com/eset/grpc-rest-proxy/actions/workflows/vulncheck.yaml) + Copyright © ESET 2024-2028 Service that is automatically translating REST requests to gRPC and sending them to provided endpoint. REST is defined using [Google's proto HTTP annotation](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto). Our implementation is able to load proto descriptors directly from grpc endpoint using server reflection service. Main advantage of this approach is elimination of the need to recompile protobufs or grpc-rest-proxy (to incorporate changes in protos), making translation and maintenance easier.