From 45ae04df5714e4c730d8f5296dcf921eb0e0e23d Mon Sep 17 00:00:00 2001 From: Sebastien Lavoie Date: Wed, 26 Feb 2020 11:41:03 -0500 Subject: [PATCH] Update travis and use go modules --- .travis.yml | 26 +++++++------------------- Makefile | 23 +++++++++++++++++++++++ dev.yml | 14 ++++++++++++++ go.mod | 8 ++++++++ go.sum | 4 ++++ 5 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 Makefile create mode 100644 dev.yml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 397d166..b8c1fb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,13 @@ language: go go: - - 1.2 - - 1.3 - - 1.4 - - 1.5 - - 1.6 - - 1.7 - - 1.8 - - 1.9 - - master + - "1.13" + - tip -# safelist -branches: - only: - - master - - v2 +go_import_path: github.com/Shopify/gomail -notifications: - email: false +script: + - make coverage -before_install: - - mkdir -p $GOPATH/src/gopkg.in && - ln -s ../github.com/go-mail/mail $GOPATH/src/gopkg.in/mail.v2 +after_success: + - if [[ -f "coverage.txt" ]]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4f06676 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +GOFILES := $(shell find . -path ./vendor -prune -o -type f -name '*.go' -print) + +all: test + +test: + go test ./... + +coverage: coverage.txt + +coverage.txt: $(GOFILES) Makefile + go test -coverprofile=coverage.txt -covermode=atomic ./... + +show-coverage: coverage.txt + go tool cover -html=coverage.txt + +style: $(GOFILES) Makefile .golangci.yml + bin/style + +clean: + go clean + rm -f coverage.txt + +.PHONY: clean test coverage show-coverage diff --git a/dev.yml b/dev.yml new file mode 100644 index 0000000..9e6c4de --- /dev/null +++ b/dev.yml @@ -0,0 +1,14 @@ +name: gomail + +up: + - go: + version: "1.13.7" + modules: true + +commands: + test: go test -race ./... + style: + run: bin/style + desc: Static verification using golangci or autofix issues when possible. + syntax: + optional: --fix diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3776cc4 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/Shopify/gomail + +go 1.13 + +require ( + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc + gopkg.in/mail.v2 v2.3.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..54dde6d --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= +gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk= +gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw=