This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,067 additions
and
331 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test Coveralls | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16.x | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Calc coverage | ||
run: TESTRUN=true go test -v ./... -covermode=count -coverprofile=coverage.out | ||
- name: gcov2lcov-action | ||
uses: jandelgado/gcov2lcov-action@v1.0.8 | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: coverage.lcov |
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,13 @@ | ||
name: Go Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run golangci-lint | ||
uses: actions-contrib/golangci-lint@v1 |
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,19 @@ | ||
name: Publish to Registry | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Publish to Registry | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: betorvs/sensubot | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
tag_semver: true |
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,18 @@ | ||
name: Go Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.16 | ||
id: go | ||
- name: Test | ||
run: TESTRUN=true go test -v ./... |
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,2 +1,4 @@ | ||
.vscode* | ||
sensubot | ||
sensubot | ||
ca.pem | ||
coverage.out |
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
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,19 +1,27 @@ | ||
FROM golang:1.13.6-alpine3.11 AS golang | ||
FROM golang:1.16.0-alpine3.12 AS golang | ||
|
||
ARG LOC=/builds/go/src/github.com/betorvs/sensubot/ | ||
RUN apk add --no-cache git | ||
RUN mkdir -p /builds/go/src/github.com/betorvs/sensubot/ | ||
ENV GOPATH /builds/go | ||
COPY . /builds/go/src/github.com/betorvs/sensubot/ | ||
RUN mkdir -p $LOC | ||
ENV GOPATH /go | ||
COPY . $LOC | ||
ENV CGO_ENABLED 0 | ||
RUN cd /builds/go/src/github.com/betorvs/sensubot/ && go build | ||
RUN cd $LOC && TESTRUN=true go test ./... && go build | ||
|
||
FROM alpine:3.11 | ||
FROM alpine:3.12 | ||
ARG LOC=/builds/go/src/github.com/betorvs/sensubot | ||
WORKDIR / | ||
VOLUME /tmp | ||
RUN apk add --no-cache ca-certificates | ||
COPY --from=golang /builds/go/src/github.com/betorvs/sensubot/sensubot / | ||
RUN update-ca-certificates | ||
RUN mkdir -p /app | ||
RUN addgroup -g 1000 -S app && \ | ||
adduser -u 1000 -G app -S -D -h /app app && \ | ||
chmod 755 /app | ||
COPY --from=golang $LOC/sensubot /app | ||
|
||
EXPOSE 9090 | ||
RUN chmod +x /sensubot | ||
CMD ["/sensubot"] | ||
RUN chmod +x /app/sensubot | ||
WORKDIR /app | ||
USER app | ||
CMD ["/app/sensubot"] |
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
32 changes: 17 additions & 15 deletions
32
appcontext/appcontext_test.go → appcontext/context_test.go
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.