Skip to content

Commit

Permalink
Add travis ci support (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
lylex committed Dec 21, 2018
1 parent 9535015 commit dfe4e36
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: go

go:
- 1.11.x

os:
- linux
- osx

dist: xenial

sudo: false

before_install:
- go get -u golang.org/x/lint/golint

install: true

env:
- GO111MODULE=on

script:
- make lint && make vet
- make test
- make build
- make dist
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ SOURCE_FILES ?= ./...

export GO111MODULE := on

.PHONY: mod
mod:
$(GO_BIN) mod download

.PHONY: test
test:
test: mod
$(GO_BIN) test -v -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.out $(SOURCE_FILES) -timeout=5m

.PHONY: cover
Expand All @@ -20,6 +24,10 @@ cover: test
lint:
$(GOLINT) ./...

.PHONY: vet
vet:
$(GO_BIN) vet ./...

.PHONY: fmt
fmt:
find . -name '*.go' -not -wholename './vendor/*' | \
Expand All @@ -29,7 +37,7 @@ fmt:
done

.PHONY: build
build:
build: mod
$(GO_BIN) build -o drm .

.PHONY: dist
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import "github.com/lylex/drm/cmd"
import (
"github.com/lylex/drm/cmd"
)

func main() {
cmd.Execute()
Expand Down
3 changes: 2 additions & 1 deletion pkg/blobs/blobs_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package blobs

import (
"fmt"
"os"
"testing"
"time"
Expand All @@ -26,7 +27,7 @@ func TestName(t *testing.T) {
ID: randStr,
}
ret := blob.Name()
expectName := "1136214245000000000_ti2SMt_testname"
expectName := fmt.Sprintf("1136214245000000000_%s_testname", randStr)
if ret != expectName {
t.Errorf("Failed to get name, expect %s, got %s", expectName, ret)
}
Expand Down
10 changes: 10 additions & 0 deletions scripts/mac/uninstall_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
# Here is the workaround since we have no `deb` or `dmg` like packages for macOS

BIN_NAME=drm
CFG_DIR=/etc/drm
DATA_DIR=/usr/local/lib/drm
BIN_DIR=/usr/local/bin/
BIN_NAME=drm

# remove files
rm -rf $CFG_DIR
rm -rf $DATA_DIR
rm -rf $BIN_DIR/$BIN_NAME


sed -i '' '/alias rm=/d' /etc/profile

Expand Down

0 comments on commit dfe4e36

Please sign in to comment.