File tree Expand file tree Collapse file tree 12 files changed +43
-73
lines changed Expand file tree Collapse file tree 12 files changed +43
-73
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.
2828### CI
2929
3030CI 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 )
3232and also upload a html ` coverage ` artifact that you can download to browse coverage.
3333
3434You can run CI locally.
@@ -42,7 +42,4 @@ See [ci/image/Dockerfile](../ci/image/Dockerfile) for the installation of the CI
4242
4343For 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.
Original file line number Diff line number Diff line change 11name : ci
2- on : [push]
2+ on : [push, pull_request ]
33
44jobs :
55 fmt :
66 runs-on : ubuntu-latest
7- container : nhooyr/websocket-ci@sha256:ea94e078d2d589d654a2c759d952bf4199c754d80dadb20696dc3902359027cb
7+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
88 steps :
99 - uses : actions/checkout@v1
1010 - run : make fmt
1111 lint :
1212 runs-on : ubuntu-latest
13- container : nhooyr/websocket-ci@sha256:ea94e078d2d589d654a2c759d952bf4199c754d80dadb20696dc3902359027cb
13+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
1414 steps :
1515 - uses : actions/checkout@v1
1616 - run : make lint
1717 test :
1818 runs-on : ubuntu-latest
19- container : nhooyr/websocket-ci@sha256:ea94e078d2d589d654a2c759d952bf4199c754d80dadb20696dc3902359027cb
19+ container : nhooyr/websocket-ci@sha256:8a8fd73fdea33585d50a33619c4936adfd016246a2ed6bbfbf06def24b518a6a
2020 steps :
2121 - uses : actions/checkout@v1
2222 - run : make test
2323 env :
24- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
24+ COVERALLS_TOKEN : ${{ secrets.github_token }}
2525 - name : Upload coverage.html
2626 uses : actions/upload-artifact@master
2727 with :
Original file line number Diff line number Diff line change @@ -4,10 +4,14 @@ all: fmt lint test
44
55.PHONY : *
66
7+ .ONESHELL :
8+ SHELL = bash
9+ .SHELLFLAGS = -ceuo pipefail
10+
711include ci/fmt.mk
812include ci/lint.mk
913include ci/test.mk
1014
1115ci-image :
12- docker build -f ./ci/image/ Dockerfile -t nhooyr/websocket-ci .
16+ docker build -f ./ci/Dockerfile -t nhooyr/websocket-ci .
1317 docker push nhooyr/websocket-ci
Original file line number Diff line number Diff line change 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+ [ ![ Coveralls ] ( 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
88websocket 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 @@ -3,7 +3,7 @@ FROM golang:1
33RUN apt-get update
44RUN apt-get install -y chromium
55RUN apt-get install -y npm
6- RUN apt-get install -y shellcheck
6+ RUN apt-get install -y jq
77
88ENV GOPATH=/root/gopath
99ENV PATH=$GOPATH/bin:$PATH
@@ -12,15 +12,12 @@ ENV PAGER=cat
1212ENV CI=true
1313ENV MAKEFLAGS="--jobs=8 --output-sync=target"
1414
15- COPY ./ci/image/gitignore /root/.config/git/ignore
16- RUN git config --system color.ui always
17-
1815RUN npm install -g prettier
1916RUN go get golang.org/x/tools/cmd/stringer
2017RUN go get golang.org/x/tools/cmd/goimports
21- RUN go get mvdan.cc/sh/cmd/shfmt
2218RUN go get golang.org/x/lint/golint
2319RUN go get github.com/agnivade/wasmbrowsertest
20+ RUN go get github.com/mattn/goveralls
2421
2522# Cache go modules and build cache.
2623COPY . /tmp/websocket
Original file line number Diff line number Diff line change 1- fmt : modtidy gofmt goimports prettier shfmt
1+ fmt : modtidy gofmt goimports prettier
22ifdef 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
410endif
511
612modtidy : gen
@@ -12,11 +18,8 @@ gofmt: gen
1218goimports : 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
2124gen :
2225 go generate ./...
Load Diff This file was deleted.
Load Diff This file was deleted.
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
22
33govet :
44 go vet ./...
@@ -11,6 +11,3 @@ golint:
1111
1212golint-wasm :
1313 GOOS=js GOARCH=wasm golint -set_exit_status ./...
14-
15- shellcheck :
16- shellcheck -x $$(git ls-files "*.sh" )
You can’t perform that action at this time.
0 commit comments