Skip to content

Commit 27f7e5f

Browse files
committed
chore: update config files
Signed-off-by: knight42 <[email protected]>
1 parent 8522136 commit 27f7e5f

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.go text eol=lf

.github/workflows/test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Test"
2+
on:
3+
push: {}
4+
pull_request: {}
5+
schedule:
6+
- cron: "0 0 * * 1" # At 0:00 on Monday
7+
workflow_dispatch: {}
8+
concurrency:
9+
group: ci-${{ github.event_name }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
permissions:
12+
contents: read
13+
jobs:
14+
test:
15+
strategy:
16+
matrix:
17+
go-version: [1.17]
18+
os: [ubuntu-latest, macos-latest]
19+
runs-on: ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Install Go
23+
uses: actions/setup-go@v2
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
- name: Cache Go Module
27+
uses: actions/cache@v2
28+
with:
29+
# In order:
30+
# * Module download cache
31+
# * Build cache (Linux)
32+
# * Build cache (Mac)
33+
# * Build cache (Windows)
34+
path: |
35+
~/go/pkg/mod
36+
~/.cache/go-build
37+
~/Library/Caches/go-build
38+
%LocalAppData%\go-build
39+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
40+
restore-keys: |
41+
${{ runner.os }}-go-
42+
- name: Test
43+
run: make test
44+
- name: Lint
45+
uses: golangci/golangci-lint-action@v2
46+
with:
47+
# use pre-installed Go
48+
skip-go-installation: true
49+
# don't cache or restore ~/go/pkg
50+
skip-pkg-cache: true

.golangci.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
run:
2+
timeout: 5m
13
linters:
24
enable:
35
- exhaustive

Makefile

+13-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ server-image:
44
push-server-image:
55
docker push knight42/krelay-server:latest
66

7+
.PHONY: krelay
8+
krelay:
9+
CGO_ENABLED=0 go build -trimpath -o krelay ./cmd/client
10+
711
.PHONY: lint
812
lint:
913
golangci-lint run
1014

11-
.PHONY: krelay
12-
krelay:
13-
CGO_ENABLED=0 go build -trimpath -o krelay ./cmd/client
15+
.PHONY: test
16+
test:
17+
go test -race -v ./...
18+
19+
.PHONY: coverage
20+
coverage:
21+
go test -race -v -coverprofile=cover.out ./...
22+
go tool cover -html cover.out
23+
rm cover.out

0 commit comments

Comments
 (0)