Skip to content

Commit

Permalink
ci: add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
didil committed May 14, 2023
1 parent 3e0030a commit d2c0cdf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Install tools
run: make install-tools

- name: Install goveralls
run: go install github.com/mattn/goveralls@latest

- name: Build
run: GOFLAGS=-v make build

Expand All @@ -55,7 +58,12 @@ jobs:
HOST: localhost
PORT: 3001
REDIS_URL: "redis://localhost:6379"
run: GOFLAGS=-v make test
run: GOFLAGS=-v make test-coverage

- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: goveralls -coverprofile=coverprofile.txt -service=github

release-please:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ bin/

# goreleaser build
dist/

# go -coverprofile
coverprofile.txt
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ install-tools:
install:
@echo MYGOBIN: $(MYGOBIN)
GOBIN=$(MYGOBIN) go install ./...

test:
go test -race ./...

test-coverage:
go test -race -covermode atomic -coverprofile=coverprofile.txt ./...

lint:
$(MYGOBIN)/golangci-lint run

Expand Down

0 comments on commit d2c0cdf

Please sign in to comment.