Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ jobs:
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
make get
- name: Lint Code
run: |
GOBIN=$HOME go install golang.org/x/tools/cmd/goimports
GOBIN=$HOME go install golang.org/x/lint/golint
GOBIN=$HOME make lint
- name: Test
run: |
go test ./... -v
make test
- name: Build Artifacts
run: |
go build -ldflags="-s -w" -o gcb-visualizer
make build
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
BIN=$(GOBIN)

build:
go build -ldflags="-s -w"
go build -ldflags="-s -w" -o gcb-visualizer

tests:
.PHONY: test
test:
go test -count=1 ./...

get:
go get -v -t -d ./...

format-lint:
gofmt -l -d .

import-lint:
${BIN}/goimports -l -d .

style-lint:
${BIN}/golint ./...

lint: format-lint import-lint style-lint
3 changes: 2 additions & 1 deletion gcb-visualizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package main

import (
"fmt"
"os"

"github.com/RyanSiu1995/gcb-visualizer/cmd"
log "github.com/sirupsen/logrus"
"os"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/cloudbuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package util
import (
"bytes"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"path"
Expand All @@ -14,6 +13,7 @@ import (
graphviz "github.com/goccy/go-graphviz"
"github.com/goccy/go-graphviz/cgraph"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
)

var supportedFormat = []string{".yaml", ".yml", ".json"}
Expand Down