File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : easyjson
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ name : Test with Go ${{ matrix.go }}
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ go : [ 1.17, 1.16, 1.15 ]
17+ steps :
18+ - uses : actions/checkout@v2
19+
20+ - name : Set up Go ${{ matrix.go }}
21+ uses : actions/setup-go@v2
22+ with :
23+ go-version : ${{ matrix.go }}
24+
25+ - name : Install golint (for old go version)
26+ if : matrix.go < 1.16
27+ run : go get golang.org/x/lint/golint && go mod tidy
28+
29+ - name : Install golint
30+ if : matrix.go > 1.15
31+ run : go install golang.org/x/lint/golint@latest
32+
33+ - name : Build and Run tests
34+ run : make
35+
36+ test-non-amd64 :
37+ runs-on : ubuntu-latest
38+ name : Test on ${{ matrix.distro }} ${{ matrix.arch }}
39+ strategy :
40+ matrix :
41+ include :
42+ - arch : ppc64le
43+ distro : ubuntu20.04
44+ steps :
45+ - uses : actions/checkout@v2
46+ - uses : uraimo/run-on-arch-action@master
47+ with :
48+ arch : ${{ matrix.arch }}
49+ distro : ${{ matrix.distro }}
50+ install : |
51+ apt-get update
52+ apt install -y curl wget make gcc
53+ latestGo=$(curl "https://golang.org/VERSION?m=text")
54+ wget --quiet "https://dl.google.com/go/${latestGo}.linux-${{ matrix.arch }}.tar.gz"
55+ rm -f $(which go)
56+ rm -rf /usr/local/go
57+ tar -C /usr/local -xzf "${latestGo}.linux-${{ matrix.arch }}.tar.gz"
58+ run : |
59+ export PATH=/usr/local/go/bin:$PATH
60+ export PATH=~/go/bin:$PATH
61+ printf "Go Version: $(go version)\n"
62+ go install golang.org/x/lint/golint@latest
63+ make
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66 rm -rf benchmark/* _easyjson.go
77
88build :
9- go build -i - o ./bin/easyjson ./easyjson
9+ go build -o ./bin/easyjson ./easyjson
1010
1111generate : build
1212 bin/easyjson -stubs \
Original file line number Diff line number Diff line change 1- # easyjson [ ![ Build Status] ( https://travis-ci.org /mailru/easyjson. svg?branch=master )] ( https://travis-ci.org/mailru/easyjson ) [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/mailru/easyjson )] ( https://goreportcard.com/report/github.com/mailru/easyjson )
1+ # easyjson [ ![ Build Status] ( https://github.com /mailru/easyjson/actions/workflows/easyjson.yml/badge. svg )] ( https://travis-ci.org/mailru/easyjson ) [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/mailru/easyjson )] ( https://goreportcard.com/report/github.com/mailru/easyjson )
22
33Package easyjson provides a fast and easy way to marshal/unmarshal Go structs
44to/from JSON without the use of reflection. In performance tests, easyjson
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ func TestStringIntern(t *testing.T) {
2020 t .Fatalf ("wrong value: %q" , i .Field )
2121 }
2222 })
23- if allocsPerRun != 1 {
24- t .Fatalf ("expected 1 allocs, got %f" , allocsPerRun )
23+ if allocsPerRun > 1 {
24+ t .Fatalf ("expected <= 1 allocs, got %f" , allocsPerRun )
2525 }
2626
2727 var n NoIntern
@@ -35,7 +35,7 @@ func TestStringIntern(t *testing.T) {
3535 t .Fatalf ("wrong value: %q" , n .Field )
3636 }
3737 })
38- if allocsPerRun != 2 {
39- t .Fatalf ("expected 2 allocs, got %f" , allocsPerRun )
38+ if allocsPerRun > 2 {
39+ t .Fatalf ("expected <= 2 allocs, got %f" , allocsPerRun )
4040 }
4141}
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ func TestNocopy(t *testing.T) {
5353 t .Fatalf ("wrong value: %q" , res .B )
5454 }
5555 })
56- if allocsPerRun != 1 {
57- t .Fatalf ("noCopy field unmarshal: expected 1 allocs, got %f" , allocsPerRun )
56+ if allocsPerRun > 1 {
57+ t .Fatalf ("noCopy field unmarshal: expected <= 1 allocs, got %f" , allocsPerRun )
5858 }
5959
6060 data = []byte (`{"a": "valueNoCopy"}` )
@@ -67,7 +67,7 @@ func TestNocopy(t *testing.T) {
6767 t .Fatalf ("wrong value: %q" , res .A )
6868 }
6969 })
70- if allocsPerRun != 2 {
71- t .Fatalf ("copy field unmarshal: expected 2 allocs, got %f" , allocsPerRun )
70+ if allocsPerRun > 2 {
71+ t .Fatalf ("copy field unmarshal: expected <= 2 allocs, got %f" , allocsPerRun )
7272 }
7373}
You can’t perform that action at this time.
0 commit comments