Skip to content

Commit

Permalink
Merge pull request #17 from berty/dev/moul/circle
Browse files Browse the repository at this point in the history
feat: setup circle ci
  • Loading branch information
moul authored Feb 11, 2020
2 parents 1965e27 + 88dd49d commit b87dd13
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 24 deletions.
38 changes: 23 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
version: 2
version: 2.1

orbs:
codecov: codecov/[email protected]
moul: moul/[email protected]
tools: gotest/[email protected]

jobs:
build:
docker:
- image: circleci/golang:1.12
#working_directory: /go/src/berty.tech/CHANGE_ME
- image: circleci/golang:1.13
working_directory: /go/src/berty.tech/yolo
environment:
GO111MODULE: "on"
#GOPROXY: "https://goproxy.io"
steps:
- checkout
#- restore_cache:
# keys:
# - go-mod-v1-{{ arch }}-{{ checksum "go.sum" }}
# - go-mod-v1-{{ arch }}-
#- run: go mod download
#- run: make test
#- run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- v1.17.1
#- run: PATH=$PATH:./bin make lint
#- save_cache:
# key: go-mod-v1-{{ arch }}-{{ checksum "go.sum" }}
# paths:
# - /go/pkg/mod
- tools/mod-download
- tools/mod-tidy-check
- run: make test
- run: make install
- moul/install_golangci-lint
- run: make lint
- codecov/upload:
file: coverage.txt

workflows:
main:
jobs:
- build
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
run:
deadline: 1m
tests: false
skip-files:
- "test/.*"
- "test/.*/.*"

linters-settings:
golint:
min-confidence: 0
maligned:
suggest-new: true
goconst:
min-len: 5
min-occurrences: 4
misspell:
locale: US

linters:
disable-all: true
enable:
- goconst
- misspell
- deadcode
- misspell
- structcheck
- errcheck
- unused
- varcheck
- staticcheck
- unconvert
- gofmt
#- goimports # disabling goimports while we can't configure it to ignore vendors (github.com/whyrusleeping/go-logging seems to be badly formated)
- golint
- ineffassign
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ test: generate
install: generate
go install ./cmd/yolo

.PHONY: lint
lint: generate
golangci-lint run

##
## generate
##
Expand Down
2 changes: 1 addition & 1 deletion gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/plistgen/plistgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
func Release(bundleID, version, title, url string) ([]byte, error) {
release := &ApplePlistRelease{
Items: []*ApplePlistItem{
&ApplePlistItem{
{
Assets: []*ApplePlistAsset{
&ApplePlistAsset{
{
Kind: "software-package",
URL: url,
},
Expand Down
2 changes: 1 addition & 1 deletion service.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (svc service) PlistGenerator(w http.ResponseWriter, r *http.Request) {
return
}
w.Header().Add("Content-Type", "application/x-plist")
w.Write(b)
_, _ = w.Write(b)
}

func (svc service) ArtifactDownloader(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit b87dd13

Please sign in to comment.