server/.drone.yml

121 lines
2.2 KiB
YAML
Raw Permalink Normal View History

2021-11-08 17:47:29 +00:00
---
kind: pipeline
type: docker
name: linux-test
steps:
- name: fetch
2024-03-09 21:51:16 +00:00
image: golang:1.21.5
2021-11-08 17:47:29 +00:00
volumes:
- name: deps
path: /go
commands:
- go install honnef.co/go/tools/cmd/staticcheck@latest
2024-03-09 21:51:16 +00:00
- go install go.uber.org/nilaway/cmd/nilaway@latest
2021-11-08 17:47:29 +00:00
- git fetch --tags
- go get
- echo `git describe --tags` > VERSION
- echo `date +%G-%m-%d-%H-%M` > BUILDDATE
- name: quality
2024-03-09 21:51:16 +00:00
image: golang:1.21.5
2021-11-08 17:47:29 +00:00
volumes:
- name: deps
path: /go
commands:
- go list ./... | xargs go vet
- staticcheck ./...
2021-11-08 17:47:29 +00:00
- name: units-tests
2024-03-09 21:51:16 +00:00
image: golang:1.21.5
2021-11-08 17:47:29 +00:00
volumes:
- name: deps
path: /go
commands:
- sh testing/tests.sh
- name: test-builda-app
2024-03-09 21:51:16 +00:00
image: golang:1.21.5
2021-11-08 17:47:29 +00:00
volumes:
- name: deps
path: /go
commands:
- cd app
- go build
- name: notify-gogs
pull: if-not-exists
2021-11-08 17:47:29 +00:00
image: openpriv/drone-gogs
when:
event: pull_request
status: [success, changed, failure]
environment:
GOGS_ACCOUNT_TOKEN:
from_secret: gogs_account_token
settings:
gogs_url: https://git.openprivacy.ca
volumes:
# gopath where bin and pkg lives to persist across steps
- name: deps
temp: {}
trigger:
repo: cwtch.im/server
branch: trunk
event:
- push
- pull_request
- tag
2021-11-08 18:29:59 +00:00
---
kind: pipeline
type: exec
name: mac-test
platform:
os: darwin
arch: amd64
steps:
- name: fetch
volumes:
- name: deps
path: /go
commands:
2021-11-08 22:25:54 +00:00
- export PATH=$PATH:/usr/local/go/bin
2021-11-08 18:29:59 +00:00
- go get
- name: units-tests
volumes:
- name: deps
path: /go
commands:
2021-11-08 22:25:54 +00:00
- export PATH=$PATH:/usr/local/go/bin
2021-11-08 18:29:59 +00:00
- sh testing/tests.sh
- name: test-builda-app
volumes:
- name: deps
path: /go
commands:
2021-11-08 22:25:54 +00:00
- export PATH=$PATH:/usr/local/go/bin
2021-11-08 18:29:59 +00:00
- cd app
- go build
volumes:
# gopath where bin and pkg lives to persist across steps
- name: deps
temp: {}
trigger:
repo: cwtch.im/server
branch: trunk
event:
- push
- pull_request
- tag
2021-11-08 22:25:54 +00:00
# TODO: windows: but need windows docker containers with
# go + gcc to compile sqlite. Will prolly come from likewise work for Cwtch