File tree Expand file tree Collapse file tree 2 files changed +15
-36
lines changed Expand file tree Collapse file tree 2 files changed +15
-36
lines changed Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
2- set -euo pipefail
1+ #! /bin/sh
2+ set -eu
3+ cd -- " $( dirname " $0 " ) /.."
34
4- main () {
5- cd " $( dirname " $0 " ) /.."
5+ go install github.com/agnivade/wasmbrowsertest@latest
6+ go test --race --timeout=1h --covermode=atomic --coverprofile=ci/out/coverage.prof --coverpkg=./... " $@ " ./...
7+ sed -i.bak ' /stringer\.go/d' ci/out/coverage.prof
8+ sed -i.bak ' /nhooyr.io\/websocket\/internal\/test/d' ci/out/coverage.prof
9+ sed -i.bak ' /examples/d' ci/out/coverage.prof
610
7- go test -timeout=30m -covermode=atomic -coverprofile=ci/out/coverage.prof -coverpkg=./... " $@ " ./...
8- sed -i.bak ' /stringer\.go/d' ci/out/coverage.prof
9- sed -i.bak ' /nhooyr.io\/websocket\/internal\/test/d' ci/out/coverage.prof
10- sed -i.bak ' /examples/d' ci/out/coverage.prof
11+ # Last line is the total coverage.
12+ go tool cover -func ci/out/coverage.prof | tail -n1
1113
12- # Last line is the total coverage.
13- go tool cover -func ci/out/coverage.prof | tail -n1
14-
15- go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
16-
17- if [[ ${CI-} && ${GITHUB_REF-} == * master ]]; then
18- local deployDir
19- deployDir=" $( mktemp -d) "
20- cp ci/out/coverage.html " $deployDir /index.html"
21- netlify deploy --prod " --dir=$deployDir "
22- fi
23- }
24-
25- main " $@ "
14+ go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
Original file line number Diff line number Diff line change 11#! /bin/sh
22set -eu
3+ cd -- " $( dirname " $0 " ) "
34
4- cd " $( dirname " $0 " ) "
5-
6- fmt () {
7- go mod tidy
8- gofmt -s -w .
9- goimports -w " -local=$( go list -m) " .
10- }
11-
12- if ! command -v wasmbrowsertest > /dev/null; then
13- go install github.com/agnivade/wasmbrowsertest@latest
14- fi
15-
16- fmt
17- go test -race --timeout=1h ./... " $@ "
5+ ./ci/fmt.sh
6+ ./ci/lint.sh
7+ ./ci/test.sh
You can’t perform that action at this time.
0 commit comments