File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env zx --experimental
1+ #!/usr/bin/env zx
22
33const expected = 90
44const exclude = [
55 'expr/test' ,
66 'checker/mock' ,
77 'vm/func_types' ,
88 'vm/runtime/helpers' ,
9+ 'internal/difflib' ,
10+ 'internal/spew' ,
11+ 'internal/testify' ,
912]
1013
1114cd ( path . resolve ( __dirname , '..' , '..' ) )
@@ -24,9 +27,11 @@ await spinner('Running tests', async () => {
2427 await $ `go tool cover -html=coverage.out -o coverage.html`
2528} )
2629
27- const cover = await $ `go tool cover -func=coverage.out`
30+ const cover = await $ ( { verbose : true } ) `go tool cover -func=coverage.out`
2831const total = + cover . stdout . match ( / t o t a l : \s + \( s t a t e m e n t s \) \s + ( \d + \. \d + ) % / ) [ 1 ]
2932if ( total < expected ) {
3033 echo ( chalk . red ( `Coverage is too low: ${ total } % < ${ expected } % (expected)` ) )
3134 process . exit ( 1 )
35+ } else {
36+ echo ( `Coverage is good: ${ chalk . green ( total + '%' ) } >= ${ expected } % (expected)` )
3237}
Original file line number Diff line number Diff line change 1111 runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v3
14- - name : Setup Go 1.18
14+ - name : Setup Go 1.12
1515 uses : actions/setup-go@v4
1616 with :
17- go-version : 1.18
17+ go-version : 1.12
1818 - name : Test
19- run : npx zx --experimental .github/scripts/coverage.mjs
19+ run : npx zx .github/scripts/coverage.mjs
You can’t perform that action at this time.
0 commit comments