Skip to content

Commit

Permalink
Merge pull request #438 from spf13/ci
Browse files Browse the repository at this point in the history
improve ci
  • Loading branch information
sagikazarmark authored Jan 9, 2025
2 parents 5c4385a + 8e89e08 commit 77b5f5d
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 39 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab
2 changes: 2 additions & 0 deletions .github/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[{*.yml,*.yaml}]
indent_size = 2
47 changes: 47 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.19", "1.20", "1.21", "1.22", "1.23"]

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: ${{ matrix.go }}

- name: Test
run: go test -race -v ./...

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: "1.23"

- name: Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.63.4
39 changes: 0 additions & 39 deletions .github/workflows/test.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/spf13/viper)

linters:
disable-all: true
enable:
- gofmt
# - gofumpt
- staticcheck

0 comments on commit 77b5f5d

Please sign in to comment.