mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Add test for pion-to-pion example
Also add new GitHub Actions workflow to run tests for example apps
This commit is contained in:
19
.github/workflows/examples-tests.yaml
vendored
Normal file
19
.github/workflows/examples-tests.yaml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Examples Tests
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pion-to-pion-test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: test
|
||||||
|
run: cd examples/pion-to-pion && ./test.sh
|
||||||
|
|
@@ -1,10 +1,12 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
answer:
|
answer:
|
||||||
|
container_name: answer
|
||||||
build: ./answer
|
build: ./answer
|
||||||
command: answer -offer-address offer:50000
|
command: answer -offer-address offer:50000
|
||||||
|
|
||||||
offer:
|
offer:
|
||||||
|
container_name: offer
|
||||||
depends_on:
|
depends_on:
|
||||||
- answer
|
- answer
|
||||||
build: ./offer
|
build: ./offer
|
||||||
|
14
examples/pion-to-pion/test.sh
Executable file
14
examples/pion-to-pion/test.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
docker compose up -d
|
||||||
|
|
||||||
|
function on_exit {
|
||||||
|
docker compose logs
|
||||||
|
docker compose rm -fsv
|
||||||
|
}
|
||||||
|
|
||||||
|
trap on_exit EXIT
|
||||||
|
|
||||||
|
TIMEOUT=10
|
||||||
|
timeout $TIMEOUT docker compose logs -f | grep -q "answer | Message from DataChannel"
|
||||||
|
timeout $TIMEOUT docker compose logs -f | grep -q "offer | Message from DataChannel"
|
Reference in New Issue
Block a user