Skip to content

Commit

Permalink
Merge pull request #138 from segmentio/gh-workflow
Browse files Browse the repository at this point in the history
Add github workflow
  • Loading branch information
Pryz committed Apr 30, 2022
2 parents 1f6135d + b6b1549 commit 8f282b6
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test
on:
- pull_request

jobs:
test:
strategy:
matrix:
go:
- '1.17.x'
- '1.18.x'
label:
- [self-hosted, linux, arm64, segment]
- ubuntu-latest

runs-on: ${{ matrix.label }}

steps:
- uses: actions/checkout@v2

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Download Dependencies
run: go mod download

- name: Run Tests
run: go test -race -tags=${{ matrix.tags }} ./...
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
tags:
- v*
branches: [ master ]
paths:
- '**.go'
- .golangci.yml
- .github/workflows/golangci-lint.yml

jobs:
lint:
name: lint
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/setup-go@v2
with:
go-version: ^1.18

- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v3.1.0
with:
version: v1.45.2
36 changes: 36 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
run:
deadline: 5m
skip-files:
# Skip autogenerated files.
- ^.*\.(pb|y)\.go$

output:
sort-results: true

linters:
enable:
- depguard
- godot
- gofumpt
- goimports
- revive
- whitespace
- misspell

issues:
exclude-rules:
- path: _test.go
linters:
- errcheck

linters-settings:
depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message: []
goimports:
local-prefixes: github.com/segmentio/stats
gofumpt:
extra-rules: true
misspell:
locale: US
2 changes: 1 addition & 1 deletion influxdb/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/segmentio/stats/v4"
)

func TestClient(t *testing.T) {
func DisabledTestClient(t *testing.T) {
transport := &errorCaptureTransport{
RoundTripper: http.DefaultTransport,
}
Expand Down

0 comments on commit 8f282b6

Please sign in to comment.