-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev and release workflow improvements (#38)
* Update Makefile; remove cruft Fixes #25 * Add CircleCI integration Fixes #24 * Clean up linter errors #24 * Add releasing with GoReleaser Fixes #36 * Fix typo
- Loading branch information
Trevor Rosen
authored
Jan 14, 2020
1 parent
7c6224c
commit 5659863
Showing
20 changed files
with
115 additions
and
555 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,26 @@ | ||
version: 2.1 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/golang:1.13.0 | ||
working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}} | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install golangci-lint | ||
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -d -b $(go env GOPATH)/bin v1.18.0 | ||
|
||
- run: | ||
name: Run lint | ||
when: always | ||
command: make lint | ||
|
||
- run: | ||
name: Run vet | ||
when: always | ||
command: make vet | ||
|
||
- run: | ||
name: Run tests | ||
when: always | ||
command: make test |
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,29 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
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,52 +1,29 @@ | ||
TEST?=$$(go list ./... |grep -v 'vendor') | ||
WEBSITE_REPO=github.com/hashicorp/terraform-website | ||
PKG_NAME=librato | ||
plugin_name=terraform-provider-appoptics | ||
plugin_path=~/.terraform.d/plugins | ||
.PHONY: build test testacc vet lint release | ||
|
||
plugin_name=terraform-provider-appoptics | ||
|
||
default: build | ||
|
||
build: | ||
go build -o $(plugin_name) | ||
|
||
user-install: | ||
mkdir -p $(plugin_path) && go build -o $(plugin_path)/$(plugin_name) | ||
test: | ||
go test ./... | ||
|
||
test: fmtcheck | ||
go test -i $(TEST) || exit 1 | ||
echo $(TEST) | \ | ||
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | ||
|
||
testacc: fmtcheck | ||
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
testacc: | ||
TF_ACC=1 go test -v -timeout 120m | ||
|
||
vet: | ||
@echo "go vet ." | ||
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | ||
echo ""; \ | ||
echo "Vet found suspicious constructs. Please check the reported constructs"; \ | ||
echo "and fix them if necessary before submitting the code for review."; \ | ||
exit 1; \ | ||
fi | ||
|
||
fmtcheck: | ||
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" | ||
|
||
errcheck: | ||
@sh -c "'$(CURDIR)/scripts/errcheck.sh'" | ||
|
||
vendor-status: | ||
@govendor status | ||
|
||
test-compile: | ||
@if [ "$(TEST)" = "./..." ]; then \ | ||
echo "ERROR: Set TEST to a specific package. For example,"; \ | ||
echo " make test-compile TEST=./$(PKG_NAME)"; \ | ||
exit 1; \ | ||
fi | ||
go test -c $(TEST) $(TESTARGS) | ||
go vet ./... | ||
|
||
lint: | ||
"$$(go env GOPATH)/bin/golangci-lint" run | ||
|
||
.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile website website-test | ||
# Produces artifacts in the dist directory | ||
# DOES NOT push release artifacts | ||
test-release: | ||
goreleaser --snapshot --skip-publish --rm-dist | ||
|
||
# Requires a GITHUB_TOKEN to be set in the environment | ||
release: | ||
goreleaser --rm-dist |
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
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.