Skip to content

Commit

Permalink
chore: use github actions
Browse files Browse the repository at this point in the history
replaces travis-ci
  • Loading branch information
mweibel committed Aug 30, 2021
1 parent bfb5dba commit a143a78
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 29 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
# * Module download cache
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.17', '1.16', '1.15', '1.14', '1.13' ]
steps:
- uses: actions/checkout@v2

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

- uses: actions/cache@v2
with:
# * Module download cache
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test -v -bench ./... -covermode=atomic -coverprofile=cover.out

- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: cover.out
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func Example() {
log.Panic(err)
}
v2, err := version.NewVersion("2.0.0")
if err != nil {
log.Panic(err)
}

output, err := MarshalUsers(v1, []string{"api"}, users)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions sheriff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,10 @@ func TestMarshal_ArrayOfInterfaceable(t *testing.T) {
}

type TestInlineStruct struct {
// explicitely testing unexported fields
// go vet complains about it and that's ok to ignore.
tableName struct{ Test string } `json:"-" is:"notexported"`
tableNameWithTag struct{ Test string } `json:"foo" is:"notexported"`
// explicitly testing unexported fields
// golangci-lint complains about it and that's ok to ignore.
tableName struct{ Test string } `json:"-"` //nolint
tableNameWithTag struct{ Test string } `json:"foo"` //nolint

Field string `json:"field"`
Field2 *string `json:"field2"`
Expand Down

0 comments on commit a143a78

Please sign in to comment.