-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bavix/nightly
[2.0] New service version
- Loading branch information
Showing
116 changed files
with
8,264 additions
and
2,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ on: | |
push: | ||
branches: | ||
- "latest" | ||
- "nightly" | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
|
||
jobs: | ||
docker: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: build app | ||
|
||
on: | ||
pull_request: | ||
branches: [ nightly, latest ] | ||
|
||
jobs: | ||
docs: | ||
permissions: | ||
contents: write | ||
uses: bavix/.github/.github/workflows/[email protected] | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Unit | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- nightly | ||
- latest | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: [ '1.21' ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
- name: Install dependencies | ||
run: go get . | ||
- name: Test with Go | ||
run: go test -json > TestResults-${{ matrix.go-version }}.json | ||
- name: Upload Go test results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Go-results-${{ matrix.go-version }} | ||
path: TestResults-${{ matrix.go-version }}.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ gripmock | |
.DS_Store | ||
protogen/* | ||
!protogen/go.mod | ||
!protogen/empty.go | ||
!protogen/example/ | ||
temp | ||
temp | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
run: | ||
timeout: 1m | ||
linters: | ||
enable-all: true | ||
disable: | ||
# deprecated | ||
- nosnakecase | ||
- structcheck | ||
- interfacer | ||
- deadcode | ||
- exhaustivestruct | ||
- maligned | ||
- ifshort | ||
- varcheck | ||
- golint | ||
- scopelint | ||
# not relevant | ||
- varnamelen | ||
- wrapcheck | ||
- paralleltest | ||
- exhaustruct | ||
linters-settings: | ||
lll: | ||
line-length: 160 | ||
gci: | ||
sections: | ||
- Standard | ||
- Default | ||
- Prefix(github.com/bavix) | ||
depguard: | ||
rules: | ||
main: | ||
allow: | ||
- $gostd | ||
- github.com | ||
issues: | ||
exclude-rules: | ||
- path: (.+)_test.go | ||
linters: | ||
- dupl |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
ARG BUILD_ARG_GO_VERSION=1.21.0 | ||
ARG BUILD_ARG_GO_VERSION=1.21 | ||
ARG BUILD_ARG_ALPINE_VERSION=3.18 | ||
FROM golang:${BUILD_ARG_GO_VERSION}-alpine${BUILD_ARG_ALPINE_VERSION} AS builder | ||
|
||
# install tools (bash, git, protobuf, protoc-gen-go, protoc-grn-go-grpc) | ||
RUN apk -U --no-cache add bash git protobuf &&\ | ||
go install -v github.com/golang/protobuf/protoc-gen-go@latest &&\ | ||
go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
|
||
# cloning well-known-types | ||
# only use needed files | ||
RUN git clone --depth=1 https://github.com/protocolbuffers/protobuf.git /protobuf-repo &&\ | ||
go install -v google.golang.org/protobuf/cmd/protoc-gen-go@latest &&\ | ||
go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest &&\ | ||
# cloning well-known-types | ||
# only use needed files | ||
git clone --depth=1 https://github.com/protocolbuffers/protobuf.git /protobuf-repo &&\ | ||
mv /protobuf-repo/src/ /protobuf/ &&\ | ||
rm -rf /protobuf-repo | ||
rm -rf /protobuf-repo &&\ | ||
# cleanup | ||
apk del git &&\ | ||
apk -v cache clean | ||
|
||
COPY . /go/src/github.com/tokopedia/gripmock | ||
COPY . /go/src/github.com/bavix/gripmock | ||
|
||
# create necessary dirs and export fix_gopackage.sh | ||
RUN mkdir /proto /stubs &&\ | ||
ln -s /go/src/github.com/tokopedia/gripmock/fix_gopackage.sh /bin/ | ||
|
||
WORKDIR /go/src/github.com/tokopedia/gripmock/protoc-gen-gripmock | ||
|
||
# install generator plugin | ||
RUN go install -v | ||
|
||
WORKDIR /go/src/github.com/tokopedia/gripmock/example/simple/client | ||
ln -s /go/src/github.com/bavix/gripmock/fix_gopackage.sh /bin/ | ||
|
||
RUN go get -u all | ||
RUN cd /go/src/github.com/bavix/gripmock/protoc-gen-gripmock &&\ | ||
go install -v &&\ | ||
cd /go/src/github.com/bavix/gripmock/example/simple/client &&\ | ||
go get -u all &&\ | ||
cd /go/src/github.com/bavix/gripmock &&\ | ||
go install -v | ||
|
||
WORKDIR /go/src/github.com/tokopedia/gripmock | ||
|
||
# install gripmock & build example to cache necessary imports | ||
RUN go install -v | ||
|
||
# remove pkgs | ||
RUN apk del git && apk -v cache clean | ||
WORKDIR /go/src/github.com/bavix/gripmock | ||
|
||
EXPOSE 4770 4771 | ||
|
||
HEALTHCHECK CMD curl --fail http://127.0.0.1:4771/api/health/readiness | ||
|
||
ENTRYPOINT ["gripmock"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.