@@ -27,25 +27,29 @@ CI must pass on your changes for them to be merged.
27
27
28
28
### CI
29
29
30
- CI will ensure your code is formatted correctly, passes linting and tests.
30
+ CI will ensure your code is formatted, lints and passes tests.
31
31
It will collect coverage and report it to [ codecov] ( https://codecov.io/gh/nhooyr/websocket )
32
- and also upload a ` coverage ` artifact that you can download to inspect browse coverage.
32
+ and also upload a html ` coverage ` artifact that you can download to browse coverage.
33
33
34
- You can run CI locally. The various steps are located in [ ci/ \* .sh ] ( ../ci ) .
34
+ You can run CI locally. You only need [ Go ] ( https://golang.org ) , [ nodejs ] ( https://nodejs.org/en/ ) and [ yarn ] ( https://yarnpkg.com ) .
35
35
36
- 1 . [ fmt.sh] ( ../ci/fmt.sh ) which requires node (specifically prettier).
37
- 1 . [ lint.sh] ( ../ci/lint.sh ) which requires [ shellcheck] ( https://github.com/koalaman/shellcheck#installing ) .
38
- 1 . [ test.sh] ( ../ci/test.sh )
39
- 1 . [ run.sh] ( ../ci/run.sh ) which runs the above scripts in order.
36
+ See the scripts in [ package.json] ( ../package.json ) .
40
37
41
- For coverage details locally, see ` ci/out/coverage.html ` after running [ test.sh] ( ../ci/test.sh ) .
38
+ 1 . ` yarn fmt ` performs code generation and formatting.
39
+ 1 . ` yarn lint ` performs linting.
40
+ 1 . ` yarn test ` runs tests.
41
+ 1 . ` yarn all ` runs the above scripts in parallel.
42
+
43
+ For coverage details locally, see ` ci/out/coverage.html ` after running ` yarn test ` .
44
+
45
+ CI is written with nodejs to enable running as much as possible concurrently.
42
46
43
47
See [ ci/image/Dockerfile] ( ../ci/image/Dockerfile ) for the installation of the CI dependencies on Ubuntu.
44
48
45
- You can also run tests normally with ` go test ` . [ test.sh ] ( ../ci/test.sh ) just passes a default set of flags to
46
- ` go test ` to collect coverage and also prettify the output .
49
+ You can also run tests normally with ` go test ` . ` yarn test` just passes a default set of flags to
50
+ ` go test ` to collect coverage and runs the WASM tests .
47
51
48
- You can pass flags to [ test.sh ] ( ../ci/test.sh ) if you want to run a specific test or otherwise
52
+ You can pass flags to ` yarn test` if you want to run a specific test or otherwise
49
53
control the behaviour of ` go test ` but also get coverage.
50
54
51
55
Coverage percentage from codecov and the CI scripts will be different because they are calculated differently.
0 commit comments