Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
workspace:
base: /go
# This path (src/github.com/**arduino**/) is important the match with the organization
path: src/github.com/arduino/${DRONE_REPO_NAME}

pipeline:

test:
image: golang:1.10
environment:
- CGO_ENABLED=0
commands:
- go generate
# Tools install dep, golangci-lint
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- go get -u github.com/golang/dep/cmd/dep
# Check the dependency, the -skip-lock is useful because the version are not fixed but depends from the branch master of the libraries so they change very often
- dep check
# Check if the code is formatted
- $(exit $(go fmt ./... | wc -l))
# Test
- go test ./... -v -cover -coverprofile cover.out
# Print the test coverage
- go tool cover -func=cover.out
- go tool cover -html=cover.out -o ${DRONE_REPO_NAME}-${CI_COMMIT_SHA:0:7}.html
# Lint
- golangci-lint run
when:
event: [push, tag, deployment]

build:
image: golang:1.10
environment:
- CGO_ENABLED=0
commands:
- go generate
- export VERSION=1.0-${CI_COMMIT_SHA:0:7}
- go build
- GOOS=linux GOARCH=arm go build -o=arduino-connector-arm
when:
event: [push, tag, deployment]
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
certificate*
arduino-connector
arduino-connector.cfg
arduino-connector-arm
arduino-connector-arm
.idea
19 changes: 19 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 13 # Should be 10 but was brought to 13 to speed up the development
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2

misspell:
locale: US

linters:
enable-all: true
Loading