Skip to content

Commit

Permalink
Merge 0e6d983 into 55795b0
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r committed Mar 31, 2020
2 parents 55795b0 + 0e6d983 commit 64889e2
Show file tree
Hide file tree
Showing 19 changed files with 536 additions and 130 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.gitignore
.env.example
.idea
.github
.vscode
testdata
docker
helm
Makefile
LICENSE
CHANGELOG.md
flottbot-*
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# name of the action
name: build

# trigger on pull_request or push events
on:
pull_request:
push:

# pipeline to execute
jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod-
- name: build
run: |
make build
32 changes: 32 additions & 0 deletions .github/workflows/publish_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# name of the action
name: publish_latest

# trigger on push events with branch master
on:
push:
branches: [master]

# pipeline to execute
jobs:
publish:
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: create docker images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
make docker-create-all
- name: push docker images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
make docker-push-latest
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# name of the action
name: release

# trigger on push events
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"

# pipeline to execute
jobs:
prerelease:
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod-
- name: create docker images
run: |
make docker-create-all
- name: push docker images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
make docker-push
- name: run goreleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# name of the action
name: test

# trigger on pull_request or push events
on:
pull_request:
push:

# pipeline to execute
jobs:
test:
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod-
- name: test
run: |
make test-race
# make test-race
- name: convert to lcov
uses: jandelgado/gcov2lcov-action@v1.0.0
with:
infile: coverage.out
outfile: coverage.lcov

- name: send to coveralls
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
30 changes: 30 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# name of the action
name: validate

# trigger on pull_request or push events
on:
pull_request:
push:

# pipeline to execute
jobs:
validate:
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomod-
- name: validate
run: |
make validate
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Temporary Items

.env
debug
flottbot
flottbot*
!flottbot/
config/

Expand Down
57 changes: 57 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
linters:
disable-all: true
enable:
# - bodyclose
# - deadcode
# - depguard
# - dogsled
# - dupl
# - errcheck
# - funlen
# - gochecknoglobals
# - gochecknoinits
# - gocognit
# - goconst
# - gocritic
- gocyclo
# - godox
# - gofmt
# - goimports
# - golint
# - gomnd
# - goprintffuncname
# - gosec
# - gosimple
# - govet
# - ineffassign
# - interfacer
# - lll
# - maligned
# - misspell
# - nakedret
# - prealloc
# - rowserrcheck
# - scopelint
# - staticcheck
# - structcheck
# - stylecheck
# - typecheck
# - unconvert
# - unparam
# - unused
# - varcheck
# - whitespace
# - wsl

linters-settings:
gocyclo:
min-complexity: 18

run:
skip-dirs:
- testdata
- helm
- config-example

service:
golangci-lint-version: 1.23.8
47 changes: 47 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
project_name: flottbot

before:
hooks:
- go mod download

builds:
- binary: flottbot

main: ./cmd/flottbot/main.go
env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPROXY=https://gocenter.io
flags:
- -a
ldflags:
- -s -w -X github.com/target/flottbot/version.Version={{.Version}} -X github.com/target/flottbot/version.GitHash={{.FullCommit}}

goos:
- linux
- darwin
- windows
goarch:
- amd64

changelog:
sort: asc
filters:
exclude:
- "^docs"
- "^test"
- Merge pull request
- Merge branch

archives:
- id: traefik
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- LICENSE

checksum:
name_template: "{{ .ProjectName }}-checksums.txt"
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

0 comments on commit 64889e2

Please sign in to comment.