Skip to content

Commit 0246482

Browse files
committed
ci: add github actions
1 parent d22e42c commit 0246482

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

.github/workflows/go.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version-file: go.mod
20+
21+
- name: Run tests
22+
run: go test -race -coverprofile=coverage.out ./...
23+
24+
- name: Upload coverage
25+
uses: codecov/codecov-action@v3
26+
with:
27+
files: ./coverage.out
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v3
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v3
37+
with:
38+
go-version-file: go.mod
39+
40+
- name: Run linters
41+
uses: golangci/golangci-lint-action@v3
42+
with:
43+
version: v1.50.0

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: [ v* ]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version-file: go.mod
20+
21+
- name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v3
23+
with:
24+
version: latest
25+
args: release --rm-dist
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.golangci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
# enabled by default:
5+
- errcheck
6+
- gosimple
7+
- govet
8+
- ineffassign
9+
- staticcheck
10+
- typecheck
11+
- unused
12+
# disabled by default:
13+
- gocritic
14+
- gofumpt
15+
16+
linters-settings:
17+
gocritic:
18+
enabled-tags:
19+
- diagnostic
20+
- style
21+
- performance
22+
- experimental
23+
- opinionated

.goreleaser.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
builds:
2+
- skip: true
3+
4+
changelog:
5+
sort: asc

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# check
22

3+
[![ci](https://github.com/junk1tm/check/actions/workflows/go.yml/badge.svg)](https://github.com/junk1tm/check/actions/workflows/go.yml)
4+
[![docs](https://pkg.go.dev/badge/github.com/junk1tm/check.svg)](https://pkg.go.dev/github.com/junk1tm/check)
5+
[![report](https://goreportcard.com/badge/github.com/junk1tm/check)](https://goreportcard.com/report/github.com/junk1tm/check)
6+
[![codecov](https://codecov.io/gh/junk1tm/check/branch/main/graph/badge.svg)](https://codecov.io/gh/junk1tm/check)
7+
38
Convenience helpers to perform validations of any kind
49

510
## 📦 Install

0 commit comments

Comments
 (0)