Skip to content

Commit a266119

Browse files
Merge pull request spf13#438 from spf13/ci
improve ci
2 parents 27f84e3 + 0e348ab commit a266119

File tree

5 files changed

+74
-39
lines changed

5 files changed

+74
-39
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.go]
12+
indent_style = tab

.github/.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[{*.yml,*.yaml}]
2+
indent_size = 2

.github/workflows/ci.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
go: ["1.19", "1.20", "1.21", "1.22", "1.23"]
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
25+
with:
26+
go-version: ${{ matrix.go }}
27+
28+
- name: Test
29+
run: go test -race -v ./...
30+
31+
lint:
32+
name: Lint
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
39+
- name: Set up Go
40+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
41+
with:
42+
go-version: "1.23"
43+
44+
- name: Lint
45+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
46+
with:
47+
version: v1.63.4

.github/workflows/test.yml

-39
This file was deleted.

.golangci.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
linters-settings:
2+
gci:
3+
sections:
4+
- standard
5+
- default
6+
- prefix(github.com/spf13/viper)
7+
8+
linters:
9+
disable-all: true
10+
enable:
11+
- gofmt
12+
# - gofumpt
13+
- staticcheck

0 commit comments

Comments
 (0)