File tree 1 file changed +39
-2
lines changed
1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,43 @@ func TestC(t *testing.T) {
53
53
54
54
> Because of ` go test ` package separation, you have to call ` buckets.Buckets(m) ` in every package you want to ignore.
55
55
56
- # Why?
56
+ ## Why?
57
57
Speed up ci pipelines by parallelizing go tests without thinking about [ t.Parallel] ( https://golang.org/pkg/testing/#T.Parallel ) .
58
- And getting rid of weird piping ` go test $(go list ./... | grep -v /ignore/) `
58
+ And getting rid of weird piping ` go test $(go list ./... | grep -v /ignore/) `
59
+
60
+
61
+ ## Extra Github Actions
62
+ You can use following github action when using test buckets:
63
+ ``` yaml
64
+ on :
65
+ push :
66
+
67
+ name : " push"
68
+ jobs :
69
+ test :
70
+ strategy :
71
+ matrix :
72
+ platform : [ubuntu-latest]
73
+ bucket : [0, 1, 2, 3]
74
+ env :
75
+ TOTAL_BUCKETS : 4
76
+ runs-on : ${{ matrix.platform }}
77
+ steps :
78
+ -
79
+ name : Checkout code
80
+
81
+ -
82
+ name : Get go.mod details
83
+
84
+ id : go-mod-details
85
+ -
86
+ name : Install Go
87
+ uses : actions/setup-go@v4
88
+ with :
89
+ go-version : ${{ steps.go-mod-details.outputs.go_version }}
90
+ -
91
+ name : Test
92
+ run : go test -v -count=1 ./...
93
+ env :
94
+ BUCKET : ${{ matrix.bucket }}
95
+ ` ` `
You can’t perform that action at this time.
0 commit comments