Skip to content

Commit

Permalink
Bump dependencies (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm authored Aug 25, 2022
1 parent 1ba021c commit 9b8fb1e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 21 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
name: lint

on:
push:
tags:
- v*
branches:
- master
- main
pull_request:

env:
GO_VERSION: "1.18.x"

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: ${{ env.GO_VERSION }}

- id: get-lint-version
run: |
make golangci-lint-version
- name: golangci-lint
- name: lint
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.46.2
version: ${{ steps.get-lint-version.outputs.GOLANGCI_LINT_VERSION }}

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

env:
GO111MODULE: "on"
GO_LATEST_VERSION: "1.18.x"
GO_LATEST_VERSION: "1.19.x"

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
go-version: [ 1.17.x, 1.18.x ]
go-version: [ 1.17.x, 1.18.x, 1.19.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ linters:
- gomnd
- ifshort
- interfacer
- ireturn
- lll
- maligned
- nonamedreturns
- nosnakecase
- nolintlint # https://github.com/golangci/golangci-lint/issues/3063
- paralleltest
- scopelint
- tagliatelle
- testpackage
- varnamelen
- wrapcheck
Expand Down
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
VENDOR_DIR = vendor
GOLANGCI_LINT_VERSION ?= v1.48.0

GO ?= go
GOLANGCI_LINT ?= golangci-lint

.PHONY: $(VENDOR_DIR) lint test test-unit
GOLANGCI_LINT ?= $(shell go env GOPATH)/bin/golangci-lint-$(GOLANGCI_LINT_VERSION)

.PHONY: $(VENDOR_DIR)
$(VENDOR_DIR):
@mkdir -p $(VENDOR_DIR)
@$(GO) mod vendor

lint:
@$(GOLANGCI_LINT) run
.PHONY: lint
lint: $(GOLANGCI_LINT) $(VENDOR_DIR)
@$(GOLANGCI_LINT) run -c .golangci.yaml

.PHONY: test
test: test-unit test-integration

## Run unit tests
.PHONY: test-unit
test-unit:
@echo ">> unit test"
@$(GO) test -gcflags=-l -coverprofile=unit.coverprofile -covermode=atomic -race ./...

.PHONY: test-integration
test-integration:
@echo ">> integration test"
@$(GO) test ./features/... -gcflags=-l -coverprofile=features.coverprofile -coverpkg ./... -godog -race

.PHONY: golangci-lint-version
golangci-lint-version:
@echo "::set-output name=GOLANGCI_LINT_VERSION::$(GOLANGCI_LINT_VERSION)"

$(GOLANGCI_LINT):
@echo "$(OK_COLOR)==> Installing golangci-lint $(GOLANGCI_LINT_VERSION)$(NO_COLOR)"; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin "$(GOLANGCI_LINT_VERSION)"
@mv ./bin/golangci-lint $(GOLANGCI_LINT)
4 changes: 2 additions & 2 deletions features/bootstrap/godog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"strings"
"testing"
Expand Down Expand Up @@ -87,7 +87,7 @@ func RunSuite(t *testing.T, path string, initScenario func(t *testing.T, ctx *go

var paths []string

files, err := ioutil.ReadDir(filepath.Clean(path))
files, err := os.ReadDir(filepath.Clean(path))
assert.NoError(t, err)

paths = make([]string, 0, len(files))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
)

require (
github.com/bool64/shared v0.1.4 // indirect
github.com/bool64/shared v0.1.5 // indirect
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm
github.com/bool64/ctxd v1.1.3 h1:YXnsXdiB0wTsyaR+PgRBDj8c0ny2lP4QxYb33i2nk7A=
github.com/bool64/ctxd v1.1.3/go.mod h1:ZJBWwFBYTMSES2gWQ+Q8ajTEMR/C1vAsbNhbml+Qk1o=
github.com/bool64/dev v0.2.5/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
github.com/bool64/dev v0.2.10 h1:ypAGBazcwyIy2JvIJio8V3kdqO7AgIAYvcckW54qxr4=
github.com/bool64/dev v0.2.10/go.mod h1:/csLrm+4oDSsKJRIVS0mrywAonLnYKFG8RvGT7Jh9b8=
github.com/bool64/shared v0.1.4 h1:zwtb1dl2QzDa9TJOq2jzDTdb5IPf9XlxTGKN8cySWT0=
github.com/bool64/dev v0.2.17 h1:jE+T92oazAIV8fvMDJrKjsF1bzfr5XezZ8bM5GS1Cl0=
github.com/bool64/dev v0.2.17/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/bool64/shared v0.1.4/go.mod h1:ryGjsnQFh6BnEXClfVlEJrzjwzat7CmA8PNS5E+jPp0=
github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
Expand Down

0 comments on commit 9b8fb1e

Please sign in to comment.