Add GitHub Actions
This commit is contained in:
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -4,3 +4,7 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
||||
49
.github/workflows/ci.yaml
vendored
Normal file
49
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
on:
|
||||
pull_request: {}
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.16"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v2"
|
||||
- uses: "actions/cache@v2"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gomod-
|
||||
|
||||
- uses: "actions/setup-go@v2"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
- run: "go build ./..."
|
||||
|
||||
lint:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v2"
|
||||
- uses: "golangci/golangci-lint-action@v2"
|
||||
|
||||
test:
|
||||
needs: "build"
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v2"
|
||||
- uses: "actions/cache@v2"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
|
||||
- uses: "actions/setup-go@v2"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
- run: "go test ./..."
|
||||
21
.golangci.yaml
Normal file
21
.golangci.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- "deadcode"
|
||||
- "errcheck"
|
||||
- "errorlint"
|
||||
- "gofmt"
|
||||
- "gosimple"
|
||||
- "govet"
|
||||
- "ineffassign"
|
||||
- "makezero"
|
||||
- "misspell"
|
||||
- "nakedret"
|
||||
- "nilerr"
|
||||
- "staticcheck"
|
||||
- "structcheck"
|
||||
- "unconvert"
|
||||
- "unparam"
|
||||
- "unused"
|
||||
- "varcheck"
|
||||
Reference in New Issue
Block a user