Skip to content

Commit

Permalink
Merge pull request #7 from eexit/update_deps
Browse files Browse the repository at this point in the history
chore: update dependencies and bump Go version to 1.20
  • Loading branch information
eexit authored Apr 11, 2023
2 parents e8e6eca + 6b2b7ef commit 9494596
Show file tree
Hide file tree
Showing 15 changed files with 705 additions and 61 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
name: Unit tests + coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ^1.16
go-version: ^1.20
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v ./...
- name: Test with coverage
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage report
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
Expand All @@ -32,37 +32,37 @@ jobs:
name: Go linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Lint the codebase
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.34
version: latest
publish:
name: Docker publish
if: contains(github.ref, 'refs/tags/')
needs: [ tests, lint ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retrieve tag
id: tagref
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
platforms: linux/amd64
build-args: version=${{ steps.tagref.outputs.tag }}+${{ github.sha }}
tags: '${{ github.repository }}:${{ steps.tagref.outputs.tag }},${{ github.repository }}:latest'
push: true
- name: Update repo description
uses: peter-evans/dockerhub-description@v2
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand All @@ -78,16 +78,16 @@ jobs:
matrix:
target: [http2smtp, http2smtp-lambda]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Retrieve tag
id: tagref
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- uses: wangyoucao577/go-release-action@v1.18
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
goos: linux
goarch: amd64
goversion: '1.16'
goversion: '1.20'
project_path: cmd/${{ matrix.target }}
binary_name: ${{ matrix.target }}
extra_files: LICENSE README.md
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM eexit/curl-healthchecker:v1.0.0 AS curl

FROM golang:1.16 AS builder
FROM golang:1.20 AS builder
RUN apt-get update -y \
&& apt-get install -y upx \
&& update-ca-certificates
Expand Down
4 changes: 2 additions & 2 deletions cmd/http2smtp-lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

var e env.Bag
envconfig.MustProcess("", &e)
Expand All @@ -43,5 +43,5 @@ func main() {
app := api.New(e, logger, smtpClient, converterProvider)
adapter := httpadapter.New(app.Wrap(app.Mux()))

lambda.StartHandler(lambda.NewHandler(adapter.ProxyWithContext))
lambda.Start(lambda.NewHandler(adapter.ProxyWithContext))
}
2 changes: 1 addition & 1 deletion cmd/http2smtp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func main() {
rand.Seed(time.Now().UTC().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

var e env.Bag
envconfig.MustProcess("", &e)
Expand Down
27 changes: 17 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
module github.com/eexit/http2smtp

go 1.16
go 1.20

require (
github.com/aws/aws-lambda-go v1.24.0
github.com/awslabs/aws-lambda-go-api-proxy v0.10.0
github.com/go-playground/validator/v10 v10.6.1
github.com/aws/aws-lambda-go v1.39.1
github.com/awslabs/aws-lambda-go-api-proxy v0.14.0
github.com/go-playground/validator/v10 v10.12.0
github.com/gorilla/mux v1.8.0
github.com/justinas/alice v1.2.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/leodido/go-urn v1.2.1 // indirect
github.com/rs/xid v1.3.0 // indirect
github.com/rs/zerolog v1.22.0
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b // indirect
golang.org/x/text v0.3.6 // indirect
github.com/rs/zerolog v1.29.0
)

require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/leodido/go-urn v1.2.3 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/rs/xid v1.4.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
)
Loading

0 comments on commit 9494596

Please sign in to comment.