Skip to content

Commit 57707af

Browse files
committedDec 30, 2022
chore: add github action
Signed-off-by: monkey92t <golang@88.com>
1 parent 07e5b2b commit 57707af

File tree

6 files changed

+77
-16
lines changed

6 files changed

+77
-16
lines changed
 

‎.github/workflows/build.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [master, v8, v9]
6+
pull_request:
7+
branches: [master, v8, v9]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: build
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
go-version: [1.18.x, 1.19.x]
20+
21+
steps:
22+
- name: Set up ${{ matrix.go-version }}
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
30+
- name: Test
31+
run: |
32+
go vet ./...
33+
go test ./...
34+
go test ./... -short -race
35+
go test ./... -run=NONE -bench=. -benchmem

‎.github/workflows/commitlint.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint Commit Messages
2+
on: [pull_request]
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
with:
10+
fetch-depth: 0
11+
- uses: wagoid/commitlint-github-action@v5

‎.github/workflows/golangci-lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- master
9+
- main
10+
- v9
11+
- v8
12+
pull_request:
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
golangci:
19+
permissions:
20+
contents: read # for actions/checkout to fetch code
21+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
22+
name: lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v3

‎.travis.yml

-12
This file was deleted.

‎client_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1600,15 +1600,15 @@ var _ = Describe("RedisMock", func() {
16001600
operationIntCmd(clientMock, func() *ExpectedInt {
16011601
return clientMock.ExpectXTrim("stream", 0)
16021602
}, func() *redis.IntCmd {
1603-
return client.XTrim(ctx, "stream", 0)
1603+
return client.XTrim(ctx, "stream", 0) // nolint:staticcheck
16041604
})
16051605
})
16061606

16071607
It("XTrimApprox", func() {
16081608
operationIntCmd(clientMock, func() *ExpectedInt {
16091609
return clientMock.ExpectXTrimApprox("stream", 0)
16101610
}, func() *redis.IntCmd {
1611-
return client.XTrimApprox(ctx, "stream", 0)
1611+
return client.XTrimApprox(ctx, "stream", 0) // nolint:staticcheck
16121612
})
16131613
})
16141614

‎cluster_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1599,15 +1599,15 @@ var _ = Describe("RedisMock", func() {
15991599
operationIntCmd(clusterMock, func() *ExpectedInt {
16001600
return clusterMock.ExpectXTrim("stream", 0)
16011601
}, func() *redis.IntCmd {
1602-
return client.XTrim(ctx, "stream", 0)
1602+
return client.XTrim(ctx, "stream", 0) // nolint:staticcheck
16031603
})
16041604
})
16051605

16061606
It("XTrimApprox", func() {
16071607
operationIntCmd(clusterMock, func() *ExpectedInt {
16081608
return clusterMock.ExpectXTrimApprox("stream", 0)
16091609
}, func() *redis.IntCmd {
1610-
return client.XTrimApprox(ctx, "stream", 0)
1610+
return client.XTrimApprox(ctx, "stream", 0) // nolint:staticcheck
16111611
})
16121612
})
16131613

0 commit comments

Comments
 (0)