Skip to content

Commit 5799c28

Browse files
committed
Update CI config
1 parent 7e28b01 commit 5799c28

File tree

4 files changed

+68
-37
lines changed

4 files changed

+68
-37
lines changed

.github/.golangci.yml

-17
This file was deleted.

.github/workflows/ci.yml

+4-20
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,19 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
go: [ '1.13', '1.15' ]
13+
go: [ '1.22' ]
1414

1515
steps:
1616
- name: Set up Go ${{ matrix.go }}
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v5
1818
with:
1919
go-version: ${{ matrix.go }}
2020

2121
- name: Check out code
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323

2424
- name: Build on Go ${{ matrix.go }}
2525
run: go build ./...
2626

2727
- name: Test
28-
run: go test -v ./...
29-
30-
31-
golangci:
32-
name: Check golangci-lint
33-
34-
runs-on: ubuntu-latest
35-
36-
steps:
37-
- name: Check out code
38-
uses: actions/checkout@v2
39-
40-
- name: golangci-lint
41-
uses: golangci/golangci-lint-action@v2
42-
with:
43-
version: v1.32
44-
args: --config .github/.golangci.yml
28+
run: go test -v -rapid.checks=10_000 ./...

.github/workflows/golangci-lint.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
12+
# pull-requests: read
13+
14+
jobs:
15+
golangci:
16+
name: lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.22'
23+
cache: false
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v4
26+
with:
27+
# Require: The version of golangci-lint to use.
28+
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
29+
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
30+
version: v1.54
31+
32+
# Optional: working directory, useful for monorepos
33+
# working-directory: somedir
34+
35+
# Optional: golangci-lint command line arguments.
36+
#
37+
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
38+
# The location of the configuration file can be changed by using `--config=`
39+
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
40+
41+
# Optional: show only new issues if it's a pull request. The default value is `false`.
42+
# only-new-issues: true
43+
44+
# Optional: if set to true, then all caching functionality will be completely disabled,
45+
# takes precedence over all other caching options.
46+
# skip-cache: true
47+
48+
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
49+
# skip-pkg-cache: true
50+
51+
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
52+
# skip-build-cache: true
53+
54+
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
55+
# install-mode: "goinstall"

.golangci.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
linters:
2+
# In addition to the default
3+
enable:
4+
- gocyclo
5+
- gofmt
6+
- goimports
7+
- gosec
8+
- prealloc
9+
- unconvert

0 commit comments

Comments
 (0)