Skip to content

Commit 157e664

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! ci: Fixes
1 parent f74ace6 commit 157e664

File tree

2 files changed

+15
-36
lines changed

2 files changed

+15
-36
lines changed

ci/test.sh

+11-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
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

make.sh

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
#!/bin/sh
22
set -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

0 commit comments

Comments
 (0)