Skip to content

Commit

Permalink
Fix CI (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc authored May 18, 2022
1 parent 5974325 commit 17708a6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
54 changes: 43 additions & 11 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,38 @@ on:
branches:
- master
pull_request:

jobs:
unit-tests:
name: unit-tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.17.x, 1.18.x ] # support latest 2 major versions
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Test
uses: cedrickring/golang-action/go1.14@1.5.2
- uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
args: make test
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download deps
run: go mod download

- name: Test
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -24,24 +46,34 @@ jobs:

lint:
name: lint
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.17.x, 1.18.x ] # support latest 2 major versions
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.38
version: v1.46

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# TODO: switch to .golangci.yml
args: >
--tests=false
-E bodyclose -E golint -E rowserrcheck -E gosec -E interfacer
-E unconvert -E dupl -E goconst -E gocognit -E goimports -E maligned -E unparam
-E dogsled -E prealloc -E gocritic -E wsl -E goprintffuncname -E gomnd
-E dogsled -E prealloc -E gocritic -E wsl -E goprintffuncname
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module github.com/vtopc/epoch

go 1.14
go 1.17

require github.com/stretchr/testify v1.6.1

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand Down

0 comments on commit 17708a6

Please sign in to comment.