diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 552e10d..f1f69bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: test on: push: @@ -18,7 +18,25 @@ jobs: steps: - uses: WillAbides/setup-go-faster@v1.13.0 with: - go-version: ^1.18 + go-version: ^1.21.5 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - run: go mod download -x + - run: go test -v ./... -race -bench=. -benchmem -cover -coverprofile cover.out 2>&1 | tee test.out + - run: go tool cover -func cover.out + lint: + runs-on: ubuntu-latest + steps: + - uses: WillAbides/setup-go-faster@v1.13.0 + with: + go-version: ^1.21.5 - uses: actions/checkout@v4 with: fetch-depth: 1 @@ -34,5 +52,11 @@ jobs: - uses: dominikh/staticcheck-action@v1.3.0 with: install-go: false - - run: go test -v ./... -race -bench=. -benchmem -cover -coverprofile cover.out 2>&1 | tee test.out - - run: go tool cover -func cover.out \ No newline at end of file + - uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: > + --enable + asasalint,bidichk,dupword,errchkjson,godot,gofumpt,gosec,gosimple,ineffassign,misspell,loggercheck,revive,unused + --disable + errcheck