File tree 4 files changed +66
-3
lines changed
4 files changed +66
-3
lines changed Original file line number Diff line number Diff line change
1
+ * .go text eol =lf
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
1
+ run :
2
+ timeout : 5m
1
3
linters :
2
4
enable :
3
5
- exhaustive
Original file line number Diff line number Diff line change @@ -4,10 +4,20 @@ server-image:
4
4
push-server-image :
5
5
docker push knight42/krelay-server:latest
6
6
7
+ .PHONY : krelay
8
+ krelay :
9
+ CGO_ENABLED=0 go build -trimpath -o krelay ./cmd/client
10
+
7
11
.PHONY : lint
8
12
lint :
9
13
golangci-lint run
10
14
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
You can’t perform that action at this time.
0 commit comments