From 778718caed8c0b54065bc5e40aa95a95fcbd2934 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sat, 2 Oct 2021 23:21:44 +0200 Subject: [PATCH] feat: setup CI with drone --- .drone.yml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 8 ++++++++ README.md | 1 + 3 files changed, 43 insertions(+) create mode 100644 .drone.yml create mode 100644 Makefile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e309885 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,34 @@ +--- +kind: pipeline +name: coopcloud.tech/tagcmp +steps: + - name: make check + image: golang:1.17 + commands: + - make check + + - name: make build + image: golang:1.17 + commands: + - make build + + - name: make test + image: golang:1.17 + commands: + - make test + + - 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 + - make test + when: + status: + - failure diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c53b1cd --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +build: + @go build . + +check: + @test -z $$(gofmt -l .) || (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1) + +test: + @go test . -cover diff --git a/README.md b/README.md index 5a32dda..54d33ad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # tagcmp +[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/tagcmp/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/coop-cloud/tagcmp) [![Go Report Card](https://goreportcard.com/badge/git.coopcloud.tech/coop-cloud/tagcmp)](https://goreportcard.com/report/git.coopcloud.tech/coop-cloud/tagcmp) Comparison operations for image tags. Because registries aren't doing this for