-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix linter warnings and update build config (#54)
* prune ci config * bump testify version * remove unused makefile goals * update readme * fix example compile errors * auto fix various linter warnings * fix circle build * match latest circle config schema * map all xml attrs in content protection structs * include in marshal
- Loading branch information
1 parent
e4ca85a
commit c91430c
Showing
15 changed files
with
207 additions
and
267 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 |
---|---|---|
@@ -1,50 +1,26 @@ | ||
--- | ||
version: 2 | ||
executorType: docker | ||
containerInfo: | ||
- image: library/golang | ||
environment: | ||
AWS_ACCESS_KEY_ID: 1 | ||
AWS_SECRET_ACCESS_KEY: 1 | ||
GLIDE_VERSION: 0.12.3 | ||
jobs: | ||
build: | ||
workdir: "/go/src/github.com/zencoder/go-dash" | ||
docker: | ||
- image: circleci/golang | ||
working_directory: "/go/src/github.com/zencoder/go-dash" | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Glide | ||
command: | | ||
set -eux | ||
curl -sSLfO https://github.com/Masterminds/glide/releases/download/v${GLIDE_VERSION}/glide-v${GLIDE_VERSION}-linux-amd64.tar.gz | ||
mkdir glide | ||
tar -xzf glide-v${GLIDE_VERSION}-linux-amd64.tar.gz -C ./glide | ||
cp ./glide/linux-amd64/glide /usr/local/bin/glide | ||
rm -r glide glide-v${GLIDE_VERSION}-linux-amd64.tar.gz | ||
curl -sSLfO https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz | ||
mkdir -p /go/bin glide | ||
tar -xzf glide-v0.12.3-linux-amd64.tar.gz -C ./glide | ||
cp ./glide/linux-amd64/glide /go/bin/glide | ||
rm -rf glide glide-v0.12.3-linux-amd64.tar.gz | ||
- restore_cache: | ||
key: glide-{{ checksum "glide.lock" }} | ||
- run: | ||
name: Download vendored Go dependencies | ||
command: glide install | ||
- run: /go/bin/glide install | ||
- save_cache: | ||
key: glide-{{ checksum "glide.lock" }} | ||
paths: | ||
- vendor | ||
- run: | ||
name: Install required tooling | ||
command: | | ||
go get golang.org/x/tools/cmd/cover | ||
go get github.com/mattn/goveralls | ||
go get github.com/modocache/gover | ||
- run: | ||
name: Run unit tests | ||
command: | | ||
make test | ||
- run: | ||
name: Collect coverage reports | ||
command: | | ||
make cover | ||
- run: | ||
name: Submit coverage to coveralls.io | ||
command: | | ||
make coveralls | ||
- run: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,31 @@ | ||
COVERAGEDIR = coverage | ||
ifdef CIRCLE_ARTIFACTS | ||
COVERAGEDIR = $(CIRCLE_ARTIFACTS) | ||
endif | ||
|
||
ifdef VERBOSE | ||
V = -v | ||
X = -x | ||
else | ||
.SILENT: | ||
endif | ||
|
||
all: test cover | ||
.DEFAULT_GOAL := all | ||
|
||
fmt: | ||
find . -not -path "./vendor/*" -name '*.go' -type f | sed 's#\(.*\)/.*#\1#' | sort -u | xargs -n1 -I {} bash -c "cd {} && goimports -w *.go && gofmt -w -s -l *.go" | ||
.PHONY: all | ||
all: test | ||
|
||
test: | ||
mkdir -p coverage | ||
go test $(V) ./mpd -race -cover -coverprofile=$(COVERAGEDIR)/mpd.coverprofile | ||
vendor: | ||
glide install | ||
|
||
cover: | ||
go tool cover -html=$(COVERAGEDIR)/mpd.coverprofile -o $(COVERAGEDIR)/mpd.html | ||
.PHONY: test | ||
test: vendor | ||
go test $(V) ./... -race | ||
|
||
tc: test cover | ||
.PHONY: generate | ||
generate: vendor | ||
GENERATE_FIXTURES=true $(MAKE) test | ||
|
||
coveralls: | ||
gover $(COVERAGEDIR) $(COVERAGEDIR)/coveralls.coverprofile | ||
goveralls -coverprofile=$(COVERAGEDIR)/coveralls.coverprofile -service=circle-ci -repotoken=$(COVERALLS_TOKEN) | ||
.PHONY: fmt | ||
fmt: | ||
find . -not -path "./vendor/*" -name '*.go' -type f | sed 's#\(.*\)/.*#\1#' | sort -u | xargs -n1 -I {} bash -c "cd {} && goimports -w *.go && gofmt -w -s -l *.go" | ||
|
||
.PHONY: clean | ||
clean: | ||
go clean | ||
rm -rf coverage/ | ||
|
||
examples-live: | ||
go run examples/live.go | ||
|
||
examples-ondemand: | ||
go run examples/ondemand.go | ||
|
||
generate: | ||
GENERATE_FIXTURES=true $(MAKE) test | ||
rm -rf vendor/ | ||
go clean -i $(X) -cache -testcache |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ | |
</AdaptationSet> | ||
</Period> | ||
</MPD> | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package: github.com/zencoder/go-dash | ||
import: | ||
- package: github.com/stretchr/testify | ||
version: 890a5c3458b43e6104ff5da8dfa139d013d77544 | ||
- package: github.com/stretchr/testify | ||
version: ^1.3.0 | ||
subpackages: | ||
- require |
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.