2021-03-11 17:36:04 +00:00
|
|
|
# Template Go (Golang) build
|
|
|
|
|
|
|
|
# This template allows you to validate your Go (Golang) code.
|
|
|
|
# The workflow allows running tests, build and code linting on the default branch.
|
|
|
|
|
|
|
|
image: golang:1.15
|
|
|
|
|
|
|
|
pipelines:
|
|
|
|
default:
|
|
|
|
- parallel:
|
2021-03-12 10:13:12 +00:00
|
|
|
- step:
|
|
|
|
name: Lint code
|
|
|
|
image: golangci/golangci-lint:v1.31.0
|
|
|
|
script:
|
|
|
|
- golangci-lint run -v
|
2021-03-11 17:36:04 +00:00
|
|
|
- step:
|
|
|
|
name: Test and Build
|
|
|
|
script:
|
2021-03-12 10:11:09 +00:00
|
|
|
# - mkdir test-reports
|
|
|
|
# - go get -u github.com/jstemmer/go-junit-report
|
|
|
|
# - go test tests/* -v 2>&1 | go-junit-report > test-reports/report.xml
|
2021-03-11 17:36:04 +00:00
|
|
|
# Build compiles the packages
|
2021-03-12 09:14:33 +00:00
|
|
|
- mkdir ./build
|
2021-03-12 10:15:35 +00:00
|
|
|
- go version
|
2021-03-12 10:11:09 +00:00
|
|
|
- go mod tidy
|
2021-03-12 10:19:38 +00:00
|
|
|
- go build -a -v -n -o ./build/ .
|