Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
ci(workflow): add test,build,docker jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgojin committed Nov 30, 2020
1 parent 8d6116b commit 74dcaa0
Show file tree
Hide file tree
Showing 11 changed files with 240 additions and 71 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: build
run: make build
34 changes: 34 additions & 0 deletions .github/workflows/docker-avp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: avp docker
on:
push:
branches:
- master
release:
types: [published]
pull_request:
branches:
- master
jobs:
build:
name: build and push
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion/avp:latest -f docker/avp.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
if: github.event_name == 'release'
run: docker tag pionwebrtc/ion/avp:latest pionwebrtc/ion/avp:"$TAG"
env:
TAG: ${{ github.event.release.tag_name }}

- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion/avp
34 changes: 34 additions & 0 deletions .github/workflows/docker-biz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: biz docker
on:
push:
branches:
- master
release:
types: [published]
pull_request:
branches:
- master
jobs:
build:
name: build and push
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion/biz:latest -f docker/biz.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
if: github.event_name == 'release'
run: docker tag pionwebrtc/ion/biz:latest pionwebrtc/ion/biz:"$TAG"
env:
TAG: ${{ github.event.release.tag_name }}

- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion/biz
34 changes: 34 additions & 0 deletions .github/workflows/docker-islb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: islb docker
on:
push:
branches:
- master
release:
types: [published]
pull_request:
branches:
- master
jobs:
build:
name: build and push
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion/islb:latest -f docker/islb.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
if: github.event_name == 'release'
run: docker tag pionwebrtc/ion/islb:latest pionwebrtc/ion/islb:"$TAG"
env:
TAG: ${{ github.event.release.tag_name }}

- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion/islb
34 changes: 34 additions & 0 deletions .github/workflows/docker-sfu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: sfu docker
on:
push:
branches:
- master
release:
types: [published]
pull_request:
branches:
- master
jobs:
build:
name: build and push
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion/sfu:latest -f docker/sfu.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
if: github.event_name == 'release'
run: docker tag pionwebrtc/ion/sfu:latest pionwebrtc/ion/sfu:"$TAG"
env:
TAG: ${{ github.event.release.tag_name }}

- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion/sfu
23 changes: 23 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: test
run: make test

- uses: codecov/codecov-action@v1
with:
file: ./cover.out
name: codecov-umbrella
fail_ci_if_error: true
33 changes: 16 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,33 @@ GO_COVERPKGS:=$(shell echo $(GO_TESTPKGS) | paste -s -d ',')
TEST_UID:=$(shell id -u)
TEST_GID:=$(shell id -g)

all: nodes

deps:
./scripts/install-run-deps.sh

go_deps:
go mod download
all: build

clean:
rm -rf bin

upx:
upx -9 bin/*

example:
go build -o bin/service-node $(GO_LDFLAGS) examples/service/service-node.go
go build -o bin/service-watch $(GO_LDFLAGS) examples/watch/service-watch.go
go_deps:
go mod download
go generate ./...

nodes: go_deps
build: go_deps
go build -o bin/biz $(GO_LDFLAGS) cmd/biz/main.go
go build -o bin/islb $(GO_LDFLAGS) cmd/islb/main.go
go build -o bin/sfu $(GO_LDFLAGS) cmd/sfu/main.go
go build -o bin/avp $(GO_LDFLAGS) cmd/avp/main.go

start_test_services:
start-services:
docker network create ionnet || true
docker-compose -f docker-compose.stable.yml up -d redis nats etcd
docker-compose -f docker-compose.yml up -d redis nats etcd

stop-services:
docker-compose -f docker-compose.yml stop redis nats etcd

run:
docker-compose up --build

test: nodes start_test_services
test: go_deps start-services
go test \
-timeout 120s \
-coverpkg=${GO_COVERPKGS} -coverprofile=cover.out -covermode=atomic \
-v -race ${GO_TESTPKGS}
11 changes: 1 addition & 10 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#
# DO NOT EDIT THIS FILE DIRECTLY
#
# It is automatically copied from https://github.com/pion/.goassets repository.
#

coverage:
status:
project:
Expand All @@ -13,7 +7,4 @@ coverage:
patch: off

ignore:
- "cmd/*"
- "cmd/**/*"
- "pkg/node/*"
- "pkg/node/**/*"
- "cmd/*"
35 changes: 19 additions & 16 deletions docker-compose.stable.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
version: "3.7"

services:
sfu:
image: pionwebrtc/ion-sfu:v0.4.6
biz:
image: pionwebrtc/ion/biz:v1.5.1
volumes:
- "./configs/certs:/configs/certs"
ports:
- "5000-5200:5000-5200/udp"
- 8443:8443
depends_on:
- nats
- etcd
networks:
- ionnet

biz:
image: pionwebrtc/ion-biz:v0.4.6
volumes:
- "./configs/certs:/configs/certs"
sfu:
image: pionwebrtc/ion/sfu:v1.5.1
ports:
- 8443:8443
- "5000-5200:5000-5200/udp"
depends_on:
- nats
- etcd
networks:
- ionnet

avp:
image: pionwebrtc/ion/avp:v1.5.1
depends_on:
- nats
- etcd
networks:
- ionnet


islb:
image: pionwebrtc/ion-islb:v0.4.6
image: pionwebrtc/ion/islb:v1.5.1
depends_on:
- nats
- etcd
Expand All @@ -34,24 +43,18 @@ services:

nats:
image: nats
ports:
- 4223:4222
networks:
- ionnet

etcd:
image: gcr.io/etcd-development/etcd:v3.4.14
entrypoint: "/usr/local/bin/etcd"
command: "--listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379"
ports:
- 2389:2379
networks:
- ionnet

redis:
image: redis:5.0.10
ports:
- 6380:6379
image: redis:6.0.9
networks:
- ionnet

Expand Down
Loading

0 comments on commit 74dcaa0

Please sign in to comment.