Skip to content

Commit

Permalink
update tooling and ci (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelk authored Aug 9, 2023
1 parent 36b3b9c commit 28d6fb9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: "1.21"
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get dependencies
run: go mod download
run: go version && go mod download

- name: Run tests with coverage
run: make test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
file: ./.testCoverage
13 changes: 9 additions & 4 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
build:
Expand All @@ -15,23 +20,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [1.19]
go: [ "1.19", "1.20", "1.21" ]

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

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install linters
run: make install-linters

- name: Get dependencies
run: go mod download
run: go version && go mod download

- name: Run tests
run: make test
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ linters:
- contextcheck # check the function whether to use a non-inherited context
- cyclop # checks function and package cyclomatic complexity
- decorder # check declaration order and count of types, constants, variables and functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- durationcheck # check for two durations multiplied together
- errcheck # checking for unchecked errors
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GOLANGCI_VERSION = v1.53.3

help: ## show help, shown by default if no target is specified
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Expand All @@ -24,4 +26,4 @@ test-coverage-web: test-coverage ## run unit tests and show test coverage in bro
go tool cover -html=.testCoverage

install-linters: ## install all used linters
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.50.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_VERSION}
2 changes: 1 addition & 1 deletion hashmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func TestGetOrInsert(t *testing.T) {
assert.Equal(t, "1", value)
}

func TestGetOrInsertHangIssue67(t *testing.T) {
func TestGetOrInsertHangIssue67(_ *testing.T) {
m := New[string, int]()

var wg sync.WaitGroup
Expand Down

0 comments on commit 28d6fb9

Please sign in to comment.