1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-01-10 00:28:36 +02:00

Merge pull request #17 from nikoksr/build/add-basic-ci

build: add build helpers and basic CI
This commit is contained in:
Niko Köser 2021-02-08 22:59:17 +01:00 committed by GitHub
commit a7c87c3e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 153 additions and 5 deletions

18
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
- "automerge"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
- "automerge"

17
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

44
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: build
on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
jobs:
notify:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Make Setup
run: |
make setup
-
name: Build
run: |
go build -v ./...
-
name: Make CI
run: |
make ci

14
.kodiak.toml Normal file
View File

@ -0,0 +1,14 @@
version = 1
[merge]
automerge_label = "automerge"
blacklist_title_regex = "^WIP.*"
method = "merge"
delete_branch_on_merge = true
notify_on_conflict = true
optimistic_updates = true
[merge.message]
title = "pull_request_title"
include_pr_number = true
body_type = "markdown"

View File

@ -1,23 +1,33 @@
# Contributing to notify
## Contributing to notify
We want to make contributing to this project as easy and transparent as
possible.
# Project structure
## Project structure
- `service` - Contains definitions for the underlying notification services.
- `service/discord` - Discord notification service.
- `service/mail` - Email notification service.
- `service/pseudo` - Pseudo notification service used internally to simulate a working service.
- `service/msteams` - Microsoft Teams notification service.
- `service/slack` - Slack notification service.
- `service/telegram` - Telegram notification service
## Commits
Commit messages should be well formatted, and to make that "standardized", we
are using Conventional Commits.
You can follow the documentation on
[their website](https://www.conventionalcommits.org).
## Pull Requests
We actively welcome your pull requests.
1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
4. Ensure the test suite passes (`make test`).
5. Make sure your code lints (`make lint`).
6. Make sure your code is well formatted (`make fmt`).
## Issues
We use GitHub issues to track public bugs. Please ensure your description is

42
Makefile Normal file
View File

@ -0,0 +1,42 @@
export GO111MODULE := on
export GOPROXY = https://proxy.golang.org,direct
###############################################################################
# DEPENDENCIES
###############################################################################
# Install all the build and lint dependencies
setup:
go mod download
go generate -v ./...
go mod tidy
.PHONY: setup
###############################################################################
# TESTS
###############################################################################
# Run all the tests
test:
go test -failfast -race -timeout=5m ./...
.PHONY: test
###############################################################################
# CODE HEALTH
###############################################################################
# gofumports and gci all go files
fmt:
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofumports -w "$$file"; done
gci -w -local github.com/nikoksr/notify .
.PHONY: fmt
# Run all the linters
lint:
golangci-lint run ./...
.PHONY: lint
ci: test lint
.PHONY: ci
.DEFAULT_GOAL := ci

View File

@ -1,3 +1,6 @@
//go:generate go install github.com/golangci/golangci-lint/cmd/golangci-lint
//go:generate go install mvdan.cc/gofumpt/gofumports
//go:generate go install github.com/daixiang0/gci
package notify
import (