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

Commit 74dcaa0

Browse files
committed
ci(workflow): add test,build,docker jobs
1 parent 8d6116b commit 74dcaa0

11 files changed

+240
-71
lines changed

Diff for: .github/workflows/build.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
build:
11+
name: build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: build
17+
run: make build

Diff for: .github/workflows/docker-avp.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: avp docker
2+
on:
3+
push:
4+
branches:
5+
- master
6+
release:
7+
types: [published]
8+
pull_request:
9+
branches:
10+
- master
11+
jobs:
12+
build:
13+
name: build and push
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 3
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: build
20+
run: docker build --tag pionwebrtc/ion/avp:latest -f docker/avp.Dockerfile .
21+
22+
- name: login
23+
if: github.event_name == 'release'
24+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
25+
26+
- name: tag
27+
if: github.event_name == 'release'
28+
run: docker tag pionwebrtc/ion/avp:latest pionwebrtc/ion/avp:"$TAG"
29+
env:
30+
TAG: ${{ github.event.release.tag_name }}
31+
32+
- name: push
33+
if: github.event_name == 'release'
34+
run: docker push pionwebrtc/ion/avp

Diff for: .github/workflows/docker-biz.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: biz docker
2+
on:
3+
push:
4+
branches:
5+
- master
6+
release:
7+
types: [published]
8+
pull_request:
9+
branches:
10+
- master
11+
jobs:
12+
build:
13+
name: build and push
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 3
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: build
20+
run: docker build --tag pionwebrtc/ion/biz:latest -f docker/biz.Dockerfile .
21+
22+
- name: login
23+
if: github.event_name == 'release'
24+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
25+
26+
- name: tag
27+
if: github.event_name == 'release'
28+
run: docker tag pionwebrtc/ion/biz:latest pionwebrtc/ion/biz:"$TAG"
29+
env:
30+
TAG: ${{ github.event.release.tag_name }}
31+
32+
- name: push
33+
if: github.event_name == 'release'
34+
run: docker push pionwebrtc/ion/biz

Diff for: .github/workflows/docker-islb.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: islb docker
2+
on:
3+
push:
4+
branches:
5+
- master
6+
release:
7+
types: [published]
8+
pull_request:
9+
branches:
10+
- master
11+
jobs:
12+
build:
13+
name: build and push
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 3
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: build
20+
run: docker build --tag pionwebrtc/ion/islb:latest -f docker/islb.Dockerfile .
21+
22+
- name: login
23+
if: github.event_name == 'release'
24+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
25+
26+
- name: tag
27+
if: github.event_name == 'release'
28+
run: docker tag pionwebrtc/ion/islb:latest pionwebrtc/ion/islb:"$TAG"
29+
env:
30+
TAG: ${{ github.event.release.tag_name }}
31+
32+
- name: push
33+
if: github.event_name == 'release'
34+
run: docker push pionwebrtc/ion/islb

Diff for: .github/workflows/docker-sfu.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: sfu docker
2+
on:
3+
push:
4+
branches:
5+
- master
6+
release:
7+
types: [published]
8+
pull_request:
9+
branches:
10+
- master
11+
jobs:
12+
build:
13+
name: build and push
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 3
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: build
20+
run: docker build --tag pionwebrtc/ion/sfu:latest -f docker/sfu.Dockerfile .
21+
22+
- name: login
23+
if: github.event_name == 'release'
24+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
25+
26+
- name: tag
27+
if: github.event_name == 'release'
28+
run: docker tag pionwebrtc/ion/sfu:latest pionwebrtc/ion/sfu:"$TAG"
29+
env:
30+
TAG: ${{ github.event.release.tag_name }}
31+
32+
- name: push
33+
if: github.event_name == 'release'
34+
run: docker push pionwebrtc/ion/sfu

Diff for: .github/workflows/test.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
name: test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: test
17+
run: make test
18+
19+
- uses: codecov/codecov-action@v1
20+
with:
21+
file: ./cover.out
22+
name: codecov-umbrella
23+
fail_ci_if_error: true

Diff for: Makefile

+16-17
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,33 @@ GO_COVERPKGS:=$(shell echo $(GO_TESTPKGS) | paste -s -d ',')
55
TEST_UID:=$(shell id -u)
66
TEST_GID:=$(shell id -g)
77

8-
all: nodes
9-
10-
deps:
11-
./scripts/install-run-deps.sh
12-
13-
go_deps:
14-
go mod download
8+
all: build
159

1610
clean:
1711
rm -rf bin
1812

19-
upx:
20-
upx -9 bin/*
21-
22-
example:
23-
go build -o bin/service-node $(GO_LDFLAGS) examples/service/service-node.go
24-
go build -o bin/service-watch $(GO_LDFLAGS) examples/watch/service-watch.go
13+
go_deps:
14+
go mod download
15+
go generate ./...
2516

26-
nodes: go_deps
17+
build: go_deps
2718
go build -o bin/biz $(GO_LDFLAGS) cmd/biz/main.go
2819
go build -o bin/islb $(GO_LDFLAGS) cmd/islb/main.go
2920
go build -o bin/sfu $(GO_LDFLAGS) cmd/sfu/main.go
21+
go build -o bin/avp $(GO_LDFLAGS) cmd/avp/main.go
3022

31-
start_test_services:
23+
start-services:
3224
docker network create ionnet || true
33-
docker-compose -f docker-compose.stable.yml up -d redis nats etcd
25+
docker-compose -f docker-compose.yml up -d redis nats etcd
26+
27+
stop-services:
28+
docker-compose -f docker-compose.yml stop redis nats etcd
29+
30+
run:
31+
docker-compose up --build
3432

35-
test: nodes start_test_services
33+
test: go_deps start-services
3634
go test \
35+
-timeout 120s \
3736
-coverpkg=${GO_COVERPKGS} -coverprofile=cover.out -covermode=atomic \
3837
-v -race ${GO_TESTPKGS}

Diff for: codecov.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#
2-
# DO NOT EDIT THIS FILE DIRECTLY
3-
#
4-
# It is automatically copied from https://github.com/pion/.goassets repository.
5-
#
6-
71
coverage:
82
status:
93
project:
@@ -13,7 +7,4 @@ coverage:
137
patch: off
148

159
ignore:
16-
- "cmd/*"
17-
- "cmd/**/*"
18-
- "pkg/node/*"
19-
- "pkg/node/**/*"
10+
- "cmd/*"

Diff for: docker-compose.stable.yml

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
version: "3.7"
22

33
services:
4-
sfu:
5-
image: pionwebrtc/ion-sfu:v0.4.6
4+
biz:
5+
image: pionwebrtc/ion/biz:v1.5.1
6+
volumes:
7+
- "./configs/certs:/configs/certs"
68
ports:
7-
- "5000-5200:5000-5200/udp"
9+
- 8443:8443
810
depends_on:
911
- nats
1012
- etcd
1113
networks:
1214
- ionnet
1315

14-
biz:
15-
image: pionwebrtc/ion-biz:v0.4.6
16-
volumes:
17-
- "./configs/certs:/configs/certs"
16+
sfu:
17+
image: pionwebrtc/ion/sfu:v1.5.1
1818
ports:
19-
- 8443:8443
19+
- "5000-5200:5000-5200/udp"
20+
depends_on:
21+
- nats
22+
- etcd
2023
networks:
2124
- ionnet
25+
26+
avp:
27+
image: pionwebrtc/ion/avp:v1.5.1
2228
depends_on:
2329
- nats
2430
- etcd
31+
networks:
32+
- ionnet
33+
2534

2635
islb:
27-
image: pionwebrtc/ion-islb:v0.4.6
36+
image: pionwebrtc/ion/islb:v1.5.1
2837
depends_on:
2938
- nats
3039
- etcd
@@ -34,24 +43,18 @@ services:
3443

3544
nats:
3645
image: nats
37-
ports:
38-
- 4223:4222
3946
networks:
4047
- ionnet
4148

4249
etcd:
4350
image: gcr.io/etcd-development/etcd:v3.4.14
4451
entrypoint: "/usr/local/bin/etcd"
4552
command: "--listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379"
46-
ports:
47-
- 2389:2379
4853
networks:
4954
- ionnet
5055

5156
redis:
52-
image: redis:5.0.10
53-
ports:
54-
- 6380:6379
57+
image: redis:6.0.9
5558
networks:
5659
- ionnet
5760

0 commit comments

Comments
 (0)