-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: E2E | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "ci-*" | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: | | ||
cargo build --release | ||
cargo build --package=whipinto --release | ||
cargo build --package=whepfrom --release | ||
- name: Install Tools | ||
run: | | ||
apt update -y && apt install ffmpeg | ||
wget https://gist.github.com/a-wing/f7b074770b558e114911e339bb6a3e84/raw/9529d71fb8abe16fe4900a0232c77b2621c8d318/multirun.sh | ||
chmod +x multirun.sh | ||
- name: Run E2E Test | ||
run: ./e2e.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
TARGET_DIR="./target/release" | ||
|
||
cat >stream.sdp <<EOF | ||
v=0 | ||
m=video 5004 RTP/AVP 96 | ||
c=IN IP4 127.0.0.1 | ||
a=rtpmap:96 VP8/90000 | ||
EOF | ||
|
||
cat >whip.sh <<EOF | ||
#!/bin/bash | ||
${TARGET_DIR}/whipinto -c vp8 -u http://localhost:3000/whip/777 --port 5003 --command "ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -cpu-used 5 -deadline 1 -g 10 -error-resilient 1 -auto-alt-ref 1 -f rtp 'rtp://127.0.0.1:{port}?pkt_size=1200'" | ||
EOF | ||
|
||
chmod +x whip.sh | ||
|
||
cat >whep.sh <<EOF | ||
#!/bin/bash | ||
sleep 10 | ||
${TARGET_DIR}/whepfrom -c vp8 -u http://localhost:3000/whep/777 -t localhost:5004 --command "ffplay -protocol_whitelist rtp,file,udp -i stream.sdp" | ||
EOF | ||
|
||
chmod +x whep.sh | ||
|
||
./multirun.sh \ | ||
"${TARGET_DIR}/live777" \ | ||
"./whip.sh" \ | ||
"./whep.sh" \ | ||
"sleep 30" | ||
|
||
rm stream.sdp | ||
rm whip.sh | ||
rm whep.sh |