From 0bbd7334917fff5d4c931e97caa91d5b89f384b9 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Tue, 6 Aug 2019 08:41:58 -0700 Subject: [PATCH] Add Makefile and Travis CI build (#200) * Add Makefile and Travis CI build * Simplify the script * Add to contributing guideline * Include Go modules and tools.go * Remove new line at eof --- .travis.yml | 17 +++++++++++++++++ Makefile | 21 +++++++++++++++++++++ go.mod | 5 +++++ go.sum | 2 ++ internal/tools.go | 27 +++++++++++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 .travis.yml create mode 100644 Makefile create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/tools.go diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..a5c5d1773 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: go +cache: + directories: + - /home/travis/gopath/pkg/mod + +go: + - 1.12.x + +env: + global: + GO111MODULE=on + +install: + - make install-tools + +script: + - make travis-ci diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..f08203cde --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# All documents to be used in spell check. +ALL_DOC := $(shell find . -name '*.md' -type f | sort) + +MISSPELL=misspell -error +MISSPELL_CORRECTION=misspell -w + +.PHONY: travis-ci +travis-ci: misspell + +.PHONY: misspell +misspell: + $(MISSPELL) $(ALL_DOC) + +.PHONY: misspell-correction +misspell-correction: + $(MISSPELL_CORRECTION) $(ALL_DOC) + +.PHONY: install-tools +install-tools: + GO111MODULE=on go install \ + github.com/client9/misspell/cmd/misspell diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..05d2650f5 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/open-telemetry/opentelemetry-specification + +go 1.12 + +require github.com/client9/misspell v0.3.4 diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..ee5948021 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= diff --git a/internal/tools.go b/internal/tools.go new file mode 100644 index 000000000..239c89ea5 --- /dev/null +++ b/internal/tools.go @@ -0,0 +1,27 @@ +// Copyright 2019, OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// +build tools + +package internal + +// This file follows the recommendation at +// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module +// on how to pin tooling dependencies to a go.mod file. +// This ensures that all systems use the same version of tools in addition to regular dependencies. + +import ( + _ "github.com/client9/misspell/cmd/misspell" +)