feat: migrate from drone to woodpecker
ci/woodpecker/push/test Pipeline was successful Details

This commit is contained in:
Dawid Wysokiński 2023-08-20 07:26:31 +02:00
parent b01466c6df
commit 8b9ae0b7fa
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892
3 changed files with 47 additions and 54 deletions

View File

@ -1,54 +0,0 @@
---
kind: pipeline
type: docker
name: test
steps:
- name: test
image: golang:1.20
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
trigger:
event:
- push
- pull_request
branch:
- master
---
kind: pipeline
type: docker
name: check-go-mod
steps:
- name: go.mod
image: golang:1.20
commands:
- go mod tidy
- git diff --exit-code go.mod
trigger:
event:
- push
- pull_request
branch:
- master
---
kind: pipeline
type: docker
name: golangci-lint
steps:
- name: golangci-lint
image: golangci/golangci-lint:v1.52
commands:
- golangci-lint run
trigger:
event:
- push
- pull_request
branch:
- master

View File

@ -57,6 +57,16 @@ linters-settings:
line-length: 150
gocyclo:
min-complexity: 10
depguard:
rules:
main:
files:
- "$all"
deny:
- pkg: reflect
desc: Please don't use reflect package
- pkg: github.com/pkg/errors
desc: Should be replaced by standard lib errors package
govet:
enable:
- asmdecl
@ -106,3 +116,9 @@ issues:
linters:
- dupl
- gocyclo
- linters:
- lll
source: "^//go:generate "
- linters:
- lll
source: "^// @Param"

31
.woodpecker/test.yml Normal file
View File

@ -0,0 +1,31 @@
when:
- event: [pull_request]
- event: push
branch:
- ${CI_REPO_DEFAULT_BRANCH}
variables:
- &go_image 'golang:1.21'
steps:
test:
image: *go_image
group: test
pull: true
commands:
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
lint:
image: golangci/golangci-lint:v1.54
pull: true
group: test
commands:
- golangci-lint run
check-go-mod:
image: *go_image
group: test
pull: true
commands:
- go mod tidy
- git diff --exit-code go.mod