let github actions build a docker image for testing

This commit is contained in:
tinyzimmer
2020-10-07 12:04:33 +03:00
parent 6a3da898a3
commit 7f765c1285
3 changed files with 21 additions and 26 deletions

18
.github/workflows/build.yml vendored Normal file
View 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

View File

@@ -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

View File

@@ -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"