mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-09 01:40:43 +08:00
let github actions build a docker image for testing
This commit is contained in:
18
.github/workflows/build.yml
vendored
Normal file
18
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
setup:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Build and push the go-gst docker image
|
||||||
|
run: make docker-build docker-push
|
25
.github/workflows/tests.yml
vendored
25
.github/workflows/tests.yml
vendored
@@ -13,32 +13,9 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.15
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: 1.15
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Get dependencies
|
|
||||||
run: |
|
|
||||||
go mod download
|
|
||||||
|
|
||||||
- name: Install gstreamer dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
||||||
libgstreamer1.0-0 libgstreamer1.0-dev libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev \
|
|
||||||
pkg-config build-essential
|
|
||||||
|
|
||||||
- name: Lint all packages
|
- name: Lint all packages
|
||||||
run: |
|
run: |
|
||||||
make lint
|
make docker-lint
|
||||||
|
4
Makefile
4
Makefile
@@ -23,7 +23,7 @@ docker-push: docker-build
|
|||||||
docker push $(DOCKER_IMAGE)
|
docker push $(DOCKER_IMAGE)
|
||||||
|
|
||||||
CMD ?= /bin/bash
|
CMD ?= /bin/bash
|
||||||
docker-run: docker-build
|
docker-run:
|
||||||
docker run --rm --privileged \
|
docker run --rm --privileged \
|
||||||
-v /lib/modules:/lib/modules:ro \
|
-v /lib/modules:/lib/modules:ro \
|
||||||
-v /sys:/sys:ro \
|
-v /sys:/sys:ro \
|
||||||
@@ -32,5 +32,5 @@ docker-run: docker-build
|
|||||||
-e HOME=/tmp \
|
-e HOME=/tmp \
|
||||||
$(DOCKER_IMAGE) $(CMD)
|
$(DOCKER_IMAGE) $(CMD)
|
||||||
|
|
||||||
docker-lint: docker-build
|
docker-lint:
|
||||||
$(MAKE) docker-run CMD="make lint"
|
$(MAKE) docker-run CMD="make lint"
|
Reference in New Issue
Block a user