Skip to content

Commit 7067c1d

Browse files
authored
add ci test for github actions (#84)
* add ci test for github actions * move to go 1.16 * remove circle ci * debug hanging test * skip gst tests on linux ci * use testing skipNow
1 parent 785b6e0 commit 7067c1d

File tree

4 files changed

+57
-30
lines changed

4 files changed

+57
-30
lines changed

.circleci/config.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on: pull_request
2+
3+
name: Unit tests
4+
jobs:
5+
test_on_mac:
6+
runs-on: macos-latest
7+
steps:
8+
- name: install gstreamer
9+
run: brew install libusb pkg-config gstreamer gst-plugins-bad gst-plugins-good gst-plugins-base gst-plugins-ugly
10+
- name: Install Go
11+
uses: actions/setup-go@v2
12+
with:
13+
go-version: 1.16.x
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: compile
17+
run: go build
18+
- name: run go test
19+
run: go test -v ./...
20+
test_on_linux:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Install Go
24+
uses: actions/setup-go@v2
25+
with:
26+
go-version: 1.16.x
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
- name: update
30+
run: sudo apt-get update
31+
- name: install libusb
32+
run: sudo apt-get install -y libusb-1.0-0-dev
33+
- name: installlibglib
34+
run: sudo apt-get install -y libglib2.0-dev
35+
- name: install gstreamer
36+
run: sudo apt-get install -y libgstreamer1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
37+
- name: compile
38+
run: go build
39+
- name: run go test
40+
run: go test -v ./...
41+
env:
42+
LINUX_CI: "true"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/danielpaulus/quicktime_video_hack
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/danielpaulus/gst v0.0.0-20200201205042-e6d2974fceb8

screencapture/gstadapter/gst_adapter_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
package gstadapter_test
22

33
import (
4+
"os"
45
"testing"
56

67
"github.com/danielpaulus/quicktime_video_hack/screencapture/gstadapter"
8+
log "github.com/sirupsen/logrus"
79
"github.com/stretchr/testify/assert"
810
)
911

12+
func skipCI(t *testing.T) {
13+
if os.Getenv("CI") != "" {
14+
t.Skip("Skipping testing in CI environment")
15+
}
16+
}
17+
1018
func TestCustomPipelineParsing(t *testing.T) {
19+
linuxCI := os.Getenv("LINUX_CI")
20+
log.Infof("linuxCI: %s", linuxCI)
21+
if linuxCI == "true" {
22+
log.Info("Skipping gstreamer test on headless containerized CI")
23+
t.SkipNow()
24+
}
1125

1226
_, err := gstadapter.NewWithCustomPipeline("daniel")
1327
assert.Error(t, err)

0 commit comments

Comments
 (0)