File tree Expand file tree Collapse file tree 6 files changed +81
-8
lines changed Expand file tree Collapse file tree 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 11![ Mux Go Banner] ( https://banner.mux.dev/?image=go )
22
3+ ![ ] ( https://github.com/muxinc/mux-go/workflows/Integration%20Test/badge.svg )
4+
35# Mux Go
46
57Official Mux API wrapper for golang projects, supporting both Mux Data and Mux Video.
Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66
7- "github.com/muxinc/mux-go"
7+ muxgo "github.com/muxinc/mux-go"
88 "github.com/muxinc/mux-go/examples/common"
99)
1010
@@ -20,7 +20,7 @@ func main() {
2020 ))
2121
2222 // ========== 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" }}
2424 e , err := client .ErrorsApi .ListErrors (muxgo .WithParams (& lep ))
2525 common .AssertNoError (err )
2626 common .AssertNotNil (e .Data )
@@ -29,4 +29,4 @@ func main() {
2929 os .Exit (255 )
3030 }
3131 fmt .Println ("list-errors ✅" )
32- }
32+ }
Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66
7- "github.com/muxinc/mux-go"
7+ muxgo "github.com/muxinc/mux-go"
88 "github.com/muxinc/mux-go/examples/common"
99)
1010
@@ -34,4 +34,4 @@ func main() {
3434 common .AssertNoError (err )
3535 common .AssertNotNil (fv .Data )
3636 fmt .Println ("list-filter-values ✅" )
37- }
37+ }
Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66
7- "github.com/muxinc/mux-go"
7+ muxgo "github.com/muxinc/mux-go"
88 "github.com/muxinc/mux-go/examples/common"
99)
1010
@@ -21,7 +21,7 @@ func main() {
2121 ))
2222
2323 // ========== 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" }}
2525 vs , err := client .VideoViewsApi .ListVideoViews (muxgo .WithParams (& p ))
2626 common .AssertNoError (err )
2727 common .AssertNotNil (vs .Data )
@@ -36,4 +36,4 @@ func main() {
3636 common .AssertNoError (err )
3737 common .AssertNotNil (v .Data )
3838 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