Skip to content

Commit

Permalink
feat(ci): added all ci jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
minight committed Apr 9, 2021
1 parent d898a23 commit fea7069
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
push:
branches:
- main
- next
pull_request:
branches:
- next
- main

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
35 changes: 35 additions & 0 deletions .github/workflows/golangcilint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.39.0

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
29 changes: 29 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: goreleaser

on:
push:
tags:
- v*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

.idea/
*.pprof
*.json
profile*
routes/
*.txt
benchmark/
dist/
*.kite
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
run:
skip-dirs:
- _templates
18 changes: 18 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
project_name: kiterunner
env:
- GO111MODULE=on
builds:
- binary: kr
id: 'default'
main: ./cmd/kiterunner/main.go
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version={{.Version}} -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Commit={{.ShortCommit}} -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Date={{.Date}}

archives:
- id: default
builds:
- default
files:
- none*

0 comments on commit fea7069

Please sign in to comment.