2022-01-15 18:07:33 +00:00
|
|
|
pipeline:
|
|
|
|
test:
|
|
|
|
image: golang:latest
|
|
|
|
commands:
|
2022-01-20 16:52:52 +00:00
|
|
|
- go build -o gpaste-client ./cmd/client/client.go
|
|
|
|
- go build -o gpaste-server ./cmd/server/server.go
|
2022-02-01 05:52:20 +00:00
|
|
|
- go test -cover -coverprofile="/tmp/cover.out" ./...
|
|
|
|
- go tool cover func="/tmp/cover.out"
|
2022-01-15 18:07:33 +00:00
|
|
|
- go vet ./...
|
|
|
|
when:
|
|
|
|
branch: master
|
|
|
|
event: [push, pull_request, tag, deployment]
|
|
|
|
|
2022-01-24 19:25:52 +00:00
|
|
|
lint:
|
2022-01-24 19:32:49 +00:00
|
|
|
image: golangci/golangci-lint:v1.43.0
|
2022-01-24 19:25:52 +00:00
|
|
|
commands:
|
2022-01-24 19:32:49 +00:00
|
|
|
- golangci-lint run
|
2022-01-24 19:25:52 +00:00
|
|
|
when:
|
|
|
|
event: [push, pull_request]
|
|
|
|
|
2022-01-15 18:07:33 +00:00
|
|
|
image-latest:
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: registry.t-juice.club/gpaste
|
|
|
|
registry: registry.t-juice.club
|
|
|
|
username: woodpecker
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
|
|
|
tags:
|
|
|
|
- latest
|
|
|
|
- "${CI_COMMIT_SHA:0:8}"
|
|
|
|
when:
|
|
|
|
branch: master
|
|
|
|
event: push
|
|
|
|
|
|
|
|
image-tagged:
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: registry.t-juice.club/gpaste
|
|
|
|
registry: registry.t-juice.club
|
|
|
|
username: woodpecker
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
|
|
|
tags:
|
|
|
|
- "${CI_COMMIT_TAG}"
|
|
|
|
when:
|
|
|
|
event: [tag]
|
|
|
|
|
|
|
|
goreleaser-tagged:
|
|
|
|
image: goreleaser/goreleaser
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
- echo "$GITEA_TOKEN" > gitea_token
|
|
|
|
- goreleaser release
|
|
|
|
when:
|
|
|
|
event: [tag]
|
|
|
|
secrets: [gitea_token]
|