File tree 6 files changed +81
-8
lines changed
6 files changed +81
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : Integration Test
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+
9
+ # I appreciate this isn't the cleanest workflow, but it's the neatest I can get it while we're
10
+ # still using dep to manage dependencies. If we move to go modules this can be cleaned up a lot.
11
+ # I'd love to use a nicer checkout path, but GitHub actions won't let you use anything above
12
+ # /home/runner/work/mux-go/mux-go/, so /home/runner/work/mux-go/mux-go/go it is!
13
+
14
+ jobs :
15
+ build :
16
+ name : Integration Test
17
+ runs-on : ubuntu-latest
18
+ env :
19
+ GOPATH : /home/runner/work/mux-go/mux-go/go
20
+ CHECKOUT_LOCATION : /home/runner/work/mux-go/mux-go/go/src/github.com/muxinc/mux-go
21
+ steps :
22
+ - name : Check out code
23
+ uses : actions/checkout@v2
24
+ with :
25
+ path : ${{env.CHECKOUT_LOCATION}}
26
+ - name : Install Go
27
+ uses : actions/setup-go@v2
28
+ - name : Install Dep
29
+ run : |
30
+ mkdir -p $GOPATH/bin
31
+ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
32
+ - name : Install Go Dependencies
33
+ run : |
34
+ cd $CHECKOUT_LOCATION
35
+ export PATH=$PATH:$(go env GOPATH)/bin
36
+ dep ensure
37
+ - name : Run Integration Tests
38
+ run : |
39
+ cd $CHECKOUT_LOCATION
40
+ bash test.sh
41
+ env :
42
+ MUX_TOKEN_ID : ${{ secrets.MUX_TOKEN_ID }}
43
+ MUX_TOKEN_SECRET : ${{ secrets.MUX_TOKEN_SECRET }}
Original file line number Diff line number Diff line change 1
1
![ Mux Go Banner] ( https://banner.mux.dev/?image=go )
2
2
3
+ ![ ] ( https://github.com/muxinc/mux-go/workflows/Integration%20Test/badge.svg )
4
+
3
5
# Mux Go
4
6
5
7
Official Mux API wrapper for golang projects, supporting both Mux Data and Mux Video.
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"os"
6
6
7
- "github.com/muxinc/mux-go"
7
+ muxgo "github.com/muxinc/mux-go"
8
8
"github.com/muxinc/mux-go/examples/common"
9
9
)
10
10
@@ -20,7 +20,7 @@ func main() {
20
20
))
21
21
22
22
// ========== list-errors ==========
23
- lep := muxgo.ListErrorsParams {Filters : []string {"browser:Chrome " }, Timeframe : []string {"7:days" }}
23
+ lep := muxgo.ListErrorsParams {Filters : []string {"browser:Safari " }, Timeframe : []string {"7:days" }}
24
24
e , err := client .ErrorsApi .ListErrors (muxgo .WithParams (& lep ))
25
25
common .AssertNoError (err )
26
26
common .AssertNotNil (e .Data )
@@ -29,4 +29,4 @@ func main() {
29
29
os .Exit (255 )
30
30
}
31
31
fmt .Println ("list-errors ✅" )
32
- }
32
+ }
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"os"
6
6
7
- "github.com/muxinc/mux-go"
7
+ muxgo "github.com/muxinc/mux-go"
8
8
"github.com/muxinc/mux-go/examples/common"
9
9
)
10
10
@@ -34,4 +34,4 @@ func main() {
34
34
common .AssertNoError (err )
35
35
common .AssertNotNil (fv .Data )
36
36
fmt .Println ("list-filter-values ✅" )
37
- }
37
+ }
Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"os"
6
6
7
- "github.com/muxinc/mux-go"
7
+ muxgo "github.com/muxinc/mux-go"
8
8
"github.com/muxinc/mux-go/examples/common"
9
9
)
10
10
@@ -21,7 +21,7 @@ func main() {
21
21
))
22
22
23
23
// ========== list-video-views ==========
24
- p := muxgo.ListVideoViewsParams {Filters : []string {"country:GB " , "browser:Chrome " }, Timeframe : []string {"7:days" }}
24
+ p := muxgo.ListVideoViewsParams {Filters : []string {"country:US " , "browser:Safari " }, Timeframe : []string {"7:days" }}
25
25
vs , err := client .VideoViewsApi .ListVideoViews (muxgo .WithParams (& p ))
26
26
common .AssertNoError (err )
27
27
common .AssertNotNil (vs .Data )
@@ -36,4 +36,4 @@ func main() {
36
36
common .AssertNoError (err )
37
37
common .AssertNotNil (v .Data )
38
38
fmt .Println ("get-video-view ✅" )
39
- }
39
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ if [ -z " ${MUX_TOKEN_ID:- } " ]
5
+ then
6
+ echo " MUX_TOKEN_ID not set"
7
+ exit 255
8
+ fi
9
+
10
+ if [ -z " ${MUX_TOKEN_SECRET:- } " ]
11
+ then
12
+ echo " MUX_TOKEN_SECRET not set"
13
+ exit 255
14
+ fi
15
+
16
+ VIDEO_TESTS=./examples/video/* /exercise* .go
17
+ for f in $VIDEO_TESTS
18
+ do
19
+ echo " ========== Running $f =========="
20
+ go run $f
21
+ done
22
+
23
+ DATA_TESTS=./examples/data/* /exercise* .go
24
+ for f in $DATA_TESTS
25
+ do
26
+ echo " ========== Running $f =========="
27
+ go run $f
28
+ done
You can’t perform that action at this time.
0 commit comments