File tree Expand file tree Collapse file tree 10 files changed +29
-52
lines changed Expand file tree Collapse file tree 10 files changed +29
-52
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ CI must pass on your changes for them to be merged.
28
28
### CI
29
29
30
30
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 )
32
32
and also upload a html ` coverage ` artifact that you can download to browse coverage.
33
33
34
34
You can run CI locally.
@@ -42,7 +42,4 @@ See [ci/image/Dockerfile](../ci/image/Dockerfile) for the installation of the CI
42
42
43
43
For coverage details locally, see ` ci/out/coverage.html ` after running ` make test ` .
44
44
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.
Original file line number Diff line number Diff line change 21
21
- uses : actions/checkout@v1
22
22
- run : make test
23
23
env :
24
- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
24
+ COVERALLS_TOKEN : ${{ secrets.COVERALLS_TOKEN }}
25
25
- name : Upload coverage.html
26
26
uses : actions/upload-artifact@master
27
27
with :
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ all: fmt lint test
4
4
5
5
.PHONY : *
6
6
7
+ .ONESHELL :
8
+ SHELL = bash
9
+ .SHELLFLAGS = -ceuo pipefail
10
+
7
11
include ci/fmt.mk
8
12
include ci/lint.mk
9
13
include ci/test.mk
Original file line number Diff line number Diff line change 1
1
# websocket
2
2
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 )
4
4
[ ![ 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 )
6
6
[ ![ Actions Status] ( https://github.com/nhooyr/websocket/workflows/ci/badge.svg )] ( https://github.com/nhooyr/websocket/actions )
7
7
8
8
websocket is a minimal and idiomatic WebSocket library for Go.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- fmt : modtidy gofmt goimports prettier shfmt
1
+ fmt : modtidy gofmt goimports prettier
2
2
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
4
10
endif
5
11
6
12
modtidy : gen
@@ -12,11 +18,8 @@ gofmt: gen
12
18
goimports : gen
13
19
goimports -w " -local=$$ (go list -m)" .
14
20
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" )
20
23
21
24
gen :
22
25
go generate ./...
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ FROM golang:1
3
3
RUN apt-get update
4
4
RUN apt-get install -y chromium
5
5
RUN apt-get install -y npm
6
- RUN apt-get install -y shellcheck
7
6
8
7
ENV GOPATH=/root/gopath
9
8
ENV PATH=$GOPATH/bin:$PATH
@@ -13,14 +12,13 @@ ENV CI=true
13
12
ENV MAKEFLAGS="--jobs=8 --output-sync=target"
14
13
15
14
COPY ./ci/image/gitignore /root/.config/git/ignore
16
- RUN git config --system color.ui always
17
15
18
16
RUN npm install -g prettier
19
17
RUN go get golang.org/x/tools/cmd/stringer
20
18
RUN go get golang.org/x/tools/cmd/goimports
21
- RUN go get mvdan.cc/sh/cmd/shfmt
22
19
RUN go get golang.org/x/lint/golint
23
20
RUN go get github.com/agnivade/wasmbrowsertest
21
+ RUN go get github.com/mattn/goveralls
24
22
25
23
# Cache go modules and build cache.
26
24
COPY . /tmp/websocket
Original file line number Diff line number Diff line change 1
- lint : govet golint govet-wasm golint-wasm shellcheck
1
+ lint : govet golint govet-wasm golint-wasm
2
2
3
3
govet :
4
4
go vet ./...
@@ -11,6 +11,3 @@ golint:
11
11
12
12
golint-wasm :
13
13
GOOS=js GOARCH=wasm golint -set_exit_status ./...
14
-
15
- shellcheck :
16
- shellcheck -x $$(git ls-files "*.sh" )
Original file line number Diff line number Diff line change 1
- test : gotest
2
-
3
- gotest : _gotest htmlcov
1
+ test : gotest ci/out/coverage.html
4
2
ifdef CI
5
- gotest : codecov
3
+ test : coveralls
6
4
endif
7
5
8
- htmlcov : _gotest
6
+ ci/out/coverage.html : gotest
9
7
go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
10
8
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
13
12
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-} ./...
16
15
sed -i ' /_stringer\.go/d' ci/out/coverage.prof
17
16
sed -i ' /wsecho\.go/d' ci/out/coverage.prof
18
17
sed -i ' /assert\.go/d' ci/out/coverage.prof
You can’t perform that action at this time.
0 commit comments