Compare commits

...

9 Commits

Author SHA1 Message Date
knoflook e76d996943 Merge branch 'main' into main 2021-07-16 09:26:38 +02:00
decentral1se c65ae974dd
Add experimental staticcheck into linting CI
See https://staticcheck.io for more. This is set to be ignored
on failure so that it doesn't disrupt current work flows but maybe
it is nice to add. Just drop the `ignore: ...` line and it will fail
builds.
2021-07-15 23:57:08 +02:00
decentral1se 9b8f16345c
Add a Go report card badge 2021-07-15 23:35:43 +02:00
decentral1se 4884c14ab3
Can't sort this as VERSION is not defined then 2021-07-15 23:26:47 +02:00
decentral1se a9d9d9de2f
Silence command echoing to focus output on errors 2021-07-15 23:01:31 +02:00
decentral1se 980f2f7684
Add format and check targets + integrate into CI 2021-07-15 23:00:33 +02:00
decentral1se 3b1dfb7562
Wire up notifications for failures 2021-07-15 22:29:31 +02:00
decentral1se 0a6ffd48cb
Sort vars 2021-07-15 22:27:30 +02:00
decentral1se 567dae83cf
Parametrize the abra path 2021-07-15 22:26:40 +02:00
3 changed files with 50 additions and 6 deletions

View File

@ -2,7 +2,40 @@
kind: pipeline
name: coopcloud.tech/abra
steps:
- name: make check
image: golang:1.16
commands:
- make check
- name: make static
image: golang:1.16
ignore: true # until we decide we all want this check
environment:
STATIC_CHECK_URL: honnef.co/go/tools/cmd/staticcheck
STATIC_CHECK_VERSION: v0.2.0
commands:
- go install $STATIC_CHECK_URL@$STATIC_CHECK_VERSION
- make static
- name: make build
image: golang:1.16
commands:
- make build
- name: notify on failure
image: plugins/matrix
settings:
homeserver: https://matrix.autonomic.zone
roomid: "IFazIpLtxiScqbHqoa:autonomic.zone"
userid: "@autono-bot:autonomic.zone"
accesstoken:
from_secret: autono_bot_access_token
depends_on:
- make check
- make build
when:
status:
- failure
trigger:
branch:
- main

View File

@ -1,18 +1,28 @@
ABRA := ./cmd/abra
COMMIT := $(shell git rev-list -1 HEAD)
VERSION := $(shell cat ./version)
GOPATH := $(shell go env GOPATH)
VERSION := $(shell cat ./version)
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'"
all: run install build clean
all: run install build clean format check static
run:
go run -ldflags=$(LDFLAGS) ./cmd/abra
@go run -ldflags=$(LDFLAGS) $(ABRA)
install:
go install -ldflags=$(LDFLAGS) ./cmd/abra
@go install -ldflags=$(LDFLAGS) $(ABRA)
build:
go build -ldflags=$(LDFLAGS) ./cmd/abra
@go build -ldflags=$(LDFLAGS) $(ABRA)
clean:
rm '$(GOPATH)/bin/abra'
@rm '$(GOPATH)/bin/abra'
format:
@gofmt -s -w .
check:
@test -z $$(gofmt -l .) || (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
static:
@staticcheck $(ABRA)

View File

@ -1,5 +1,6 @@
# go-abra
[![Build Status](https://drone.autonomic.zone/api/badges/coop-cloud/go-abra/status.svg?ref=refs/heads/main)](https://drone.autonomic.zone/coop-cloud/go-abra)
[![Go Report Card](https://goreportcard.com/badge/git.autonomic.zone/coop-cloud/go-abra)](https://goreportcard.com/report/git.autonomic.zone/coop-cloud/go-abra)
WIP port of [abra](https://git.autonomic.zone/coop-cloud/abra) to Golang.