File tree Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Expand file tree Collapse file tree 4 files changed +44
-21
lines changed Original file line number Diff line number Diff line change 1+ name : tests
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+ strategy :
13+ fail-fast : false
14+ matrix :
15+ go : [1.16.x, 1.17.x, 1.18.x]
16+ steps :
17+ - uses : actions/checkout@v2
18+
19+ - name : Set up Go
20+ uses : actions/setup-go@v2
21+ with :
22+ go-version : ${{ matrix.go }}
23+
24+ - name : Install goveralls
25+ run : go install github.com/mattn/goveralls@latest
26+
27+ - name : Build
28+ run : go build -v ./...
29+
30+ - name : Run tests
31+ run : go test -race -covermode=atomic -coverprofile=covprofile -v ./...
32+
33+ - name : Update coverage
34+ env :
35+ COVERALLS_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36+ run : goveralls -coverprofile=covprofile -service=github
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33APNS/2 is a go package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provider API.
44
5- [ ![ Build Status] ( https://travis-ci.org /sideshow/apns2. svg?branch=master )] ( https://travis-ci.org /sideshow/apns2 ) [ ![ Coverage Status] ( https://coveralls.io/repos/sideshow/apns2/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/sideshow/apns2?branch=master ) [ ![ GoDoc] ( https://godoc.org/github.com/sideshow/apns2?status.svg )] ( https://godoc.org/github.com/sideshow/apns2 )
5+ [ ![ Build Status] ( https://github.com /sideshow/apns2/actions/workflows/tests.yml/badge. svg )] ( https://github.com /sideshow/apns2/actions/workflows/tests.yml ) [ ![ Coverage Status] ( https://coveralls.io/repos/sideshow/apns2/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/sideshow/apns2?branch=master ) [ ![ GoDoc] ( https://godoc.org/github.com/sideshow/apns2?status.svg )] ( https://godoc.org/github.com/sideshow/apns2 )
66
77## Features
88
@@ -27,6 +27,7 @@ go get -u github.com/sideshow/apns2
2727```
2828
2929If you are running the test suite you will also need to install testify:
30+
3031``` sh
3132go get -u github.com/stretchr/testify
3233```
@@ -60,7 +61,7 @@ func main() {
6061 // client := apns2.NewClient(cert).Development()
6162 // For apps published to the app store or installed as an ad-hoc distribution use Production()
6263
63- client := apns2.NewClient (cert).Production ()
64+ client := apns2.NewClient (cert).Production ()
6465 res , err := client.Push (notification)
6566
6667 if err != nil {
Original file line number Diff line number Diff line change 66 "crypto/elliptic"
77 "crypto/rand"
88 "crypto/tls"
9+ "errors"
910 "fmt"
1011 "io/ioutil"
1112 "net"
@@ -139,8 +140,10 @@ func TestDialTLSTimeout(t *testing.T) {
139140 if _ , e = dialTLS ("tcp" , address , nil ); e == nil {
140141 t .Fatal ("Dial completed successfully" )
141142 }
142- if ! strings .Contains (e .Error (), "timed out" ) {
143- t .Errorf ("resulting error not a timeout: %s" , e )
143+ // Go 1.7.x and later will return a context deadline exceeded error
144+ // Previous versions will return a time out
145+ if ! strings .Contains (e .Error (), "timed out" ) && ! errors .Is (e , context .DeadlineExceeded ) {
146+ t .Errorf ("Unexpected error: %s" , e )
144147 }
145148}
146149
You can’t perform that action at this time.
0 commit comments