Skip to content

Commit 2d35d72

Browse files
committed
Switch to coveralls.io from codecov.io
codecov's uploader keeps failing due to the API being unresponsive and the UI is cluttered compared to codecov.
1 parent 0d98321 commit 2d35d72

File tree

10 files changed

+29
-52
lines changed

10 files changed

+29
-52
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CI must pass on your changes for them to be merged.
2828
### CI
2929

3030
CI will ensure your code is formatted, lints and passes tests.
31-
It will collect coverage and report it to [codecov](https://codecov.io/gh/nhooyr/websocket)
31+
It will collect coverage and report it to [coveralls](https://coveralls.io/github/nhooyr/websocket)
3232
and also upload a html `coverage` artifact that you can download to browse coverage.
3333

3434
You can run CI locally.
@@ -42,7 +42,4 @@ See [ci/image/Dockerfile](../ci/image/Dockerfile) for the installation of the CI
4242

4343
For coverage details locally, see `ci/out/coverage.html` after running `make test`.
4444

45-
You can also run tests normally with `go test`. `make test` just passes a default set of flags to
46-
`go test` to collect coverage and runs the WASM tests.
47-
48-
Coverage percentage from codecov and the CI scripts will be different because they are calculated differently.
45+
You can run tests normally with `go test`. `make test` wraps around `go test` to collect coverage.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v1
2222
- run: make test
2323
env:
24-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
24+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
2525
- name: Upload coverage.html
2626
uses: actions/upload-artifact@master
2727
with:

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ all: fmt lint test
44

55
.PHONY: *
66

7+
.ONESHELL:
8+
SHELL = bash
9+
.SHELLFLAGS = -ceuo pipefail
10+
711
include ci/fmt.mk
812
include ci/lint.mk
913
include ci/test.mk

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# websocket
22

3-
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nhooyr/websocket?color=6b9ded&sort=semver)](https://github.com/nhooyr/websocket/releases)
3+
[![GitHub Release](https://img.shields.io/github/v/release/nhooyr/websocket?color=6b9ded&sort=semver)](https://github.com/nhooyr/websocket/releases)
44
[![GoDoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://godoc.org/nhooyr.io/websocket)
5-
[![Codecov](https://img.shields.io/codecov/c/github/nhooyr/websocket.svg?color=65d6a4)](https://codecov.io/gh/nhooyr/websocket)
5+
[![Codecov](https://img.shields.io/coveralls/github/nhooyr/websocket?color=65d6a4)](https://coveralls.io/github/nhooyr/websocket)
66
[![Actions Status](https://github.com/nhooyr/websocket/workflows/ci/badge.svg)](https://github.com/nhooyr/websocket/actions)
77

88
websocket is a minimal and idiomatic WebSocket library for Go.

ci/.codecov.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

ci/fmt.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
fmt: modtidy gofmt goimports prettier shfmt
1+
fmt: modtidy gofmt goimports prettier
22
ifdef CI
3-
./ci/fmtcheck.sh
3+
if [[ $$(git ls-files --other --modified --exclude-standard) != "" ]]; then
4+
echo "Files need generation or are formatted incorrectly:"
5+
git -c color.ui=always status | grep --color=no '\e\[31m'
6+
echo "Please run the following locally:"
7+
echo " make fmt"
8+
exit 1
9+
fi
410
endif
511

612
modtidy: gen
@@ -12,11 +18,8 @@ gofmt: gen
1218
goimports: gen
1319
goimports -w "-local=$$(go list -m)" .
1420

15-
prettier: gen
16-
prettier --write --print-width=120 --no-semi --trailing-comma=all --loglevel=warn $$(git ls-files "*.yaml" "*.yml" "*.md" "*.ts")
17-
18-
shfmt: gen
19-
shfmt -i 2 -w -s -sr .
21+
prettier:
22+
prettier --write --print-width=120 --no-semi --trailing-comma=all --loglevel=warn $$(git ls-files "*.yml" "*.md")
2023

2124
gen:
2225
go generate ./...

ci/fmtcheck.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

ci/image/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM golang:1
33
RUN apt-get update
44
RUN apt-get install -y chromium
55
RUN apt-get install -y npm
6-
RUN apt-get install -y shellcheck
76

87
ENV GOPATH=/root/gopath
98
ENV PATH=$GOPATH/bin:$PATH
@@ -13,14 +12,13 @@ ENV CI=true
1312
ENV MAKEFLAGS="--jobs=8 --output-sync=target"
1413

1514
COPY ./ci/image/gitignore /root/.config/git/ignore
16-
RUN git config --system color.ui always
1715

1816
RUN npm install -g prettier
1917
RUN go get golang.org/x/tools/cmd/stringer
2018
RUN go get golang.org/x/tools/cmd/goimports
21-
RUN go get mvdan.cc/sh/cmd/shfmt
2219
RUN go get golang.org/x/lint/golint
2320
RUN go get github.com/agnivade/wasmbrowsertest
21+
RUN go get github.com/mattn/goveralls
2422

2523
# Cache go modules and build cache.
2624
COPY . /tmp/websocket

ci/lint.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
lint: govet golint govet-wasm golint-wasm shellcheck
1+
lint: govet golint govet-wasm golint-wasm
22

33
govet:
44
go vet ./...
@@ -11,6 +11,3 @@ golint:
1111

1212
golint-wasm:
1313
GOOS=js GOARCH=wasm golint -set_exit_status ./...
14-
15-
shellcheck:
16-
shellcheck -x $$(git ls-files "*.sh")

ci/test.mk

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
test: gotest
2-
3-
gotest: _gotest htmlcov
1+
test: gotest ci/out/coverage.html
42
ifdef CI
5-
gotest: codecov
3+
test: coveralls
64
endif
75

8-
htmlcov: _gotest
6+
ci/out/coverage.html: gotest
97
go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
108

11-
codecov: _gotest
12-
curl -s https://codecov.io/bash | bash -s -- -Z -f ci/out/coverage.prof
9+
coveralls: gotest
10+
echo "--- coveralls"
11+
goveralls -coverprofile=ci/out/coverage.prof -service=github-actions
1312

14-
_gotest:
15-
go test -parallel=32 -coverprofile=ci/out/coverage.prof -coverpkg=./... $$TESTFLAGS ./...
13+
gotest:
14+
go test -parallel=32 -covermode=count -coverprofile=ci/out/coverage.prof -coverpkg=./... $${TESTFLAGS-} ./...
1615
sed -i '/_stringer\.go/d' ci/out/coverage.prof
1716
sed -i '/wsecho\.go/d' ci/out/coverage.prof
1817
sed -i '/assert\.go/d' ci/out/coverage.prof

0 commit comments

Comments
 (0)