93 lines
2.2 KiB
YAML
93 lines
2.2 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
- pull_request
|
|
- tag
|
|
|
|
steps:
|
|
- name: Setup
|
|
image: docker.io/golang:1.20-bullseye
|
|
network_mode: host
|
|
commands:
|
|
- apt-get update && apt-get install -y jq
|
|
- go mod download
|
|
- go install "github.com/vektra/mockery/v2@$(curl https://api.github.com/repos/vektra/mockery/releases | jq -r '. | first | .tag_name')"
|
|
- go generate ./...
|
|
volumes:
|
|
- name: go-cache
|
|
path: /go
|
|
|
|
- name: Lint
|
|
image: docker.io/golangci/golangci-lint:latest
|
|
environment:
|
|
CGO_ENABLED: "0"
|
|
GOMEMLIMIT: "1150MiB"
|
|
NITTER_BASE_ADDRESS: https://code.icb4dc0.de
|
|
NITTER_TOKEN:
|
|
from_secret: gitea_token
|
|
commands:
|
|
- mkdir out
|
|
- golangci-lint run --out-format json --issues-exit-code 0 > out/results.json
|
|
- if [ -n "$DRONE_PULL_REQUEST}" ]; then go run main.go gitea pr --namespace "$${DRONE_REPO_NAMESPACE}" --repo "$${DRONE_REPO_NAME}" --result-file out/results.json --pull-index "$${DRONE_PULL_REQUEST}"; fi
|
|
depends_on:
|
|
- Setup
|
|
volumes:
|
|
- name: go-cache
|
|
path: /go
|
|
|
|
- name: Test
|
|
image: docker.io/golang:1.20-bullseye
|
|
network_mode: host
|
|
environment:
|
|
CGO_ENABLED: "1"
|
|
DOCKER_HOST: tcp://localhost:2375
|
|
commands:
|
|
- go install gotest.tools/gotestsum@latest
|
|
- gotestsum --junitfile out/results.xml --format pkgname-and-test-fails -- -race -shuffle=on ./...
|
|
depends_on:
|
|
- Setup
|
|
volumes:
|
|
- name: go-cache
|
|
path: /go
|
|
|
|
- name: junit-reports
|
|
image: ghcr.io/rohit-gohri/drone-junit:v0
|
|
settings:
|
|
paths: out/results.xml
|
|
depends_on:
|
|
- Test
|
|
|
|
volumes:
|
|
- name: go-cache
|
|
temp: { }
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: housekeeping
|
|
|
|
trigger:
|
|
event:
|
|
- cron
|
|
cron:
|
|
- housekeeping
|
|
|
|
steps:
|
|
- name: Renovate
|
|
image: code.icb4dc0.de/prskr/ci-images/renovate:latest
|
|
commands:
|
|
- renovate "${DRONE_REPO}"
|
|
environment:
|
|
RENOVATE_TOKEN:
|
|
from_secret: gitea_token
|
|
GITHUB_COM_TOKEN:
|
|
from_secret: github_token
|
|
RENOVATE_PLATFORM: gitea
|
|
RENOVATE_AUTODISCOVER: "false"
|
|
RENOVATE_ENDPOINT: https://code.icb4dc0.de/api/v1
|
|
LOG_LEVEL: info
|