forked from muxinc/mux-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Video and Data Integration tests in CI (muxinc#12)
* First pass of github actions * Match starter workflow, which I think is broken * There will be a lot of debug commits coming * Create gobin * dep ensure * Workaround path issues * Nightmare * Debug all the things * Hopefully * Rebuild paths under the limited directory structure github allows * Try and run a test maybe * no-op * Pull creds * Run all tests. Will likely fail, concerningly. * First pass at cleaning up workflow * Move GOPATH to the top level * Remove empty env statements * A little more cleanup and some commenting * Try cleaning up using variables liberally * 1 is the default fetch depth anyway * Cleanup, commenting, correct triggers * Badge it! * Cleanup tests to use Safari as per synthetic views
- Loading branch information
Showing
6 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Integration Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
# I appreciate this isn't the cleanest workflow, but it's the neatest I can get it while we're | ||
# still using dep to manage dependencies. If we move to go modules this can be cleaned up a lot. | ||
# I'd love to use a nicer checkout path, but GitHub actions won't let you use anything above | ||
# /home/runner/work/mux-go/mux-go/, so /home/runner/work/mux-go/mux-go/go it is! | ||
|
||
jobs: | ||
build: | ||
name: Integration Test | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: /home/runner/work/mux-go/mux-go/go | ||
CHECKOUT_LOCATION: /home/runner/work/mux-go/mux-go/go/src/github.com/muxinc/mux-go | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{env.CHECKOUT_LOCATION}} | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
- name: Install Dep | ||
run: | | ||
mkdir -p $GOPATH/bin | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
- name: Install Go Dependencies | ||
run: | | ||
cd $CHECKOUT_LOCATION | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
dep ensure | ||
- name: Run Integration Tests | ||
run: | | ||
cd $CHECKOUT_LOCATION | ||
bash test.sh | ||
env: | ||
MUX_TOKEN_ID: ${{ secrets.MUX_TOKEN_ID }} | ||
MUX_TOKEN_SECRET: ${{ secrets.MUX_TOKEN_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [ -z "${MUX_TOKEN_ID:-}" ] | ||
then | ||
echo "MUX_TOKEN_ID not set" | ||
exit 255 | ||
fi | ||
|
||
if [ -z "${MUX_TOKEN_SECRET:-}" ] | ||
then | ||
echo "MUX_TOKEN_SECRET not set" | ||
exit 255 | ||
fi | ||
|
||
VIDEO_TESTS=./examples/video/*/exercise*.go | ||
for f in $VIDEO_TESTS | ||
do | ||
echo "========== Running $f ==========" | ||
go run $f | ||
done | ||
|
||
DATA_TESTS=./examples/data/*/exercise*.go | ||
for f in $DATA_TESTS | ||
do | ||
echo "========== Running $f ==========" | ||
go run $f | ||
done |