File tree Expand file tree Collapse file tree 17 files changed +178
-212
lines changed Expand file tree Collapse file tree 17 files changed +178
-212
lines changed Original file line number Diff line number Diff line change
1
+ version : 2
2
+ jobs :
3
+ fmt :
4
+ docker :
5
+ - image : golang:1
6
+ steps :
7
+ - checkout
8
+ - restore_cache :
9
+ keys :
10
+ - go-{{ checksum "go.sum" }}
11
+ # Fallback to using the latest cache if no exact match is found.
12
+ - go-
13
+ - run : ./ci/fmt.sh
14
+ - save_cache :
15
+ paths :
16
+ - /go
17
+ - ~/.cache/go-build
18
+ key : go-{{ checksum "go.sum" }}
19
+
20
+ lint :
21
+ docker :
22
+ - image : golang:1
23
+ steps :
24
+ - checkout
25
+ - restore_cache :
26
+ keys :
27
+ - go-{{ checksum "go.sum" }}
28
+ # Fallback to using the latest cache if no exact match is found.
29
+ - go-
30
+ - run : ./ci/lint.sh
31
+ - save_cache :
32
+ paths :
33
+ - /go
34
+ - ~/.cache/go-build
35
+ key : go-{{ checksum "go.sum" }}
36
+
37
+ test :
38
+ docker :
39
+ - image : golang:1
40
+ steps :
41
+ - checkout
42
+ - restore_cache :
43
+ keys :
44
+ - go-{{ checksum "go.sum" }}
45
+ # Fallback to using the latest cache if no exact match is found.
46
+ - go-
47
+ - run : ./ci/test.sh
48
+ - save_cache :
49
+ paths :
50
+ - /go
51
+ - ~/.cache/go-build
52
+ key : go-{{ checksum "go.sum" }}
53
+
54
+ workflows :
55
+ version : 2
56
+ fmt :
57
+ jobs :
58
+ - fmt
59
+ lint :
60
+ jobs :
61
+ - lint
62
+ test :
63
+ jobs :
64
+ - test
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ comment : off
1
2
coverage :
2
3
status :
3
4
# Prevent small changes in coverage from failing CI.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- source ci/lib.sh || exit 1
3
+ set -euo pipefail
4
+ cd " $( dirname " ${0} " ) "
5
+ source ./lib.sh
4
6
5
7
go test --vet=off --run=^$ -bench=. -o=ci/out/websocket.test \
6
- -cpuprofile=ci/out/cpu.prof \
7
- -memprofile=ci/out/mem.prof \
8
- -blockprofile=ci/out/block.prof \
9
- -mutexprofile=ci/out/mutex.prof \
10
- .
8
+ -cpuprofile=ci/out/cpu.prof \
9
+ -memprofile=ci/out/mem.prof \
10
+ -blockprofile=ci/out/block.prof \
11
+ -mutexprofile=ci/out/mutex.prof \
12
+ .
11
13
12
- set +x
13
14
echo
14
15
echo " profiles are in ./ci/out/*.prof
15
16
keep in mind that every profiler Go provides is enabled so that may skew the benchmarks"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ cd " $( dirname " ${0} " ) "
5
+ source ./lib.sh
6
+
7
+ unstaged_files () {
8
+ git ls-files --other --modified --exclude-standard
9
+ }
10
+
11
+ gen () {
12
+ # Unfortunately, this is the only way to ensure go.mod and go.sum are correct.
13
+ # See https://github.com/golang/go/issues/27005
14
+ go list ./... > /dev/null
15
+ go mod tidy
16
+
17
+ go generate ./...
18
+ }
19
+
20
+ fmt () {
21
+ gofmt -w -s .
22
+ go run go.coder.com/go-tools/cmd/goimports -w " -local=$( go list -m) " .
23
+ go run mvdan.cc/sh/cmd/shfmt -i 2 -w -s -sr .
24
+ }
25
+
26
+ gen
27
+ fmt
28
+
29
+ if [[ $CI && $( unstaged_files) != " " ]]; then
30
+ echo
31
+ echo " files either need generation or are formatted incorrectly"
32
+ echo " please run:"
33
+ echo " ./ci/fmt.sh"
34
+ echo
35
+ git status
36
+ exit 1
37
+ fi
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -euxo pipefail || exit 1
4
-
5
- export GO111MODULE=on
6
- export PAGER=cat
7
-
8
- # shellcheck disable=SC2034
9
- # CI is used by the scripts that source this file.
10
- export CI=${GITHUB_ACTION-}
3
+ set -euo pipefail
11
4
5
+ # Ensures $CI can be used if it's set or not.
6
+ export CI=${CI:- }
12
7
if [[ $CI ]]; then
13
- export GOFLAGS=-mod=readonly
8
+ export GOFLAGS=-mod=readonly
9
+ export DEBIAN_FRONTEND=noninteractive
14
10
fi
11
+
12
+ cd " $( git rev-parse --show-toplevel) "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+ cd " $( dirname " ${0} " ) "
5
+ source ./lib.sh
6
+
7
+ if [[ $CI ]]; then
8
+ apt-get update -qq
9
+ apt-get install -qq shellcheck
10
+ fi
11
+
12
+ # shellcheck disable=SC2046
13
+ shellcheck -e SC1091 -x $( git ls-files " *.sh" )
14
+ go vet ./...
15
+ go run golang.org/x/lint/golint -set_exit_status ./...
You can’t perform that action at this time.
0 commit comments