@@ -177,22 +177,30 @@ jobs:
177177 go-version : ' 1.22'
178178 - name : Verify Go version
179179 run : go version
180- - name : Start Pion
180+ - name : Start Pion and Stream with FFmpeg
181181 run : |
182182 set -euxo pipefail
183183 git clone https://github.com/pion/webrtc.git
184184 cd webrtc/examples/whip-whep
185185 go run *.go &
186- - name : Streaming with FFmpeg
187- run : |
188- set -euxo pipefail
186+
187+ # Wait for Pion to be ready
188+ for ((i=0; i<30; i++)); do
189+ if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/whip | grep -qv "000"; then
190+ echo "Pion is ready"
191+ break
192+ fi
193+ echo "Waiting for Pion... ($i)"
194+ sleep 1
195+ done
196+
197+ cd $GITHUB_WORKSPACE
189198 nohup ./ffmpeg -t 30 -re -f lavfi -i testsrc=size=1280x720 -f lavfi -i sine=frequency=440 -pix_fmt yuv420p \
190199 -vcodec libx264 -profile:v baseline -r 25 -g 50 -acodec libopus -ar 48000 -ac 2 \
191200 -f whip -authorization "seanTest" "http://localhost:8080/whip" \
192201 1>ffstdout.log 2>ffstderr.log &
193- - name : Stop FFmpeg normally
194- run : |
195- pkill -SIGINT ffmpeg && sleep 3 ||
202+ sleep 10
203+ pkill -SIGINT ffmpeg && sleep 3 ||
196204 echo "FFmpeg process not found or already stopped."
197205 - name : Show FFmpeg Stdout Log
198206 run : cat ffstdout.log
@@ -203,9 +211,11 @@ jobs:
203211 set -euxo pipefail
204212 cat ffstderr.log |grep 'Exiting normally' && exit 0
205213 echo "Exiting normally not found in ffstderr.log" && exit 1
206- - name : Check Stream Existence
207- if : ${{ steps.streaming.outputs.has_stream == 'false' }}
208- run : exit 1
214+ - name : Check FFmpeg Streamed Successfully
215+ run : |
216+ set -euxo pipefail
217+ cat ffstderr.log |grep -v 'Connection refused' |grep 'frame=' |grep -v 'frame= 0' && exit 0
218+ echo "FFmpeg did not stream any frames" && exit 1
209219 runs-on : ubuntu-22.04
210220
211221 janus :
@@ -679,7 +689,7 @@ jobs:
679689 runs-on : ubuntu-22.04
680690
681691 mbedtls :
682- name : " With mbedTLS"
692+ name : " With mbedTLS 3.6.2 "
683693 needs : build
684694 steps :
685695 - name : Checkout repository
@@ -705,11 +715,16 @@ jobs:
705715
706716 # Build FFmpeg with WebRTC support using mbedTLS
707717 PKG_CONFIG_PATH="$HOME/.release/mbedtls/lib/pkgconfig" \
708- ./configure --enable-muxer=whip --enable-mbedtls \
718+ ./configure --enable-muxer=whip --enable-mbedtls --enable-version3 \
709719 --extra-cflags="-I$HOME/.release/mbedtls/include" \
710- --extra-ldflags="-L$HOME/.release/mbedtls/lib -Wl,-rpath,$HOME/.release/mbedtls/lib "
720+ --extra-ldflags="-L$HOME/.release/mbedtls/lib"
711721 make -j$(nproc)
712722 ./ffmpeg -version && ./ffmpeg -muxers 2>/dev/null |grep whip
723+
724+ - name : Setup tmate session
725+ if : ${{ failure() }}
726+ uses : mxschmitt/action-tmate@v3
727+
713728 - name : Start SRS Docker container
714729 run : |
715730 set -euxo pipefail
@@ -761,74 +776,6 @@ jobs:
761776 run : exit 1
762777 runs-on : ubuntu-22.04
763778
764- generate-patch :
765- name : " Generate Patch"
766- if : ${{ github.event_name == 'pull_request' }}
767- steps :
768- # Checkout to workflows branch, make sure the base branch is available.
769- - name : Checkout repository with workflows branch
770- uses : actions/checkout@v4
771- with :
772- ref : workflows
773- fetch-depth : 0
774- - name : Try to checkout to workflows branch
775- run : |
776- set -euxo pipefail
777- git checkout workflows
778- git branch -vv
779- # Checkout to PR commit, use the lastest script.
780- - name : Checkout repository to PR commit
781- uses : actions/checkout@v4
782- - name : Show Git Info
783- run : |
784- set -euxo pipefail
785- git branch -vv
786- echo "Repository: ${{ github.repository }}"
787- echo "Ref: ${{ github.ref }}"
788- echo "Event Name: ${{ github.event_name }}"
789- echo "Pull Request Number: ${{ github.event.pull_request.number }}"
790- - name : Install Dependencies
791- run : |
792- set -euxo pipefail
793- sudo apt-get update
794- sudo apt-get install -y jq
795- - name : Run Script
796- id : format_patch
797- run : |
798- set -euxo pipefail
799-
800- PR_NUMBER=${{ github.event.pull_request.number }}
801- PATCH_FILENAME="whip-patch-$PR_NUMBER-$(date +%s)"
802- TMP_BRANCH="tmp-branch-for-patch-$PR_NUMBER"
803- echo "PR ID is ${{ github.event.pull_request.number }}"
804- echo "Patch file is $PATCH_FILENAME.patch"
805- echo "Temporary branch is $TMP_BRANCH"
806-
807- bash .github/scripts/format-patch.sh $PR_NUMBER "$PATCH_FILENAME.patch"
808- echo "patch_file=$PATCH_FILENAME" >> $GITHUB_OUTPUT
809- echo "temporary_branch=$TMP_BRANCH" >> $GITHUB_OUTPUT
810-
811- if [[ -f "$PATCH_FILENAME.patch" ]]; then
812- echo "has_patch=true" >> $GITHUB_OUTPUT
813- else
814- echo "has_patch=false" >> $GITHUB_OUTPUT
815- fi
816- - name : Show Branch Info
817- if : ${{ steps.format_patch.outputs.has_patch == 'true' }}
818- run : git show ${{ steps.format_patch.outputs.temporary_branch }}
819- - name : Show Patch File
820- if : ${{ steps.format_patch.outputs.has_patch == 'true' }}
821- run : cat ${{ steps.format_patch.outputs.patch_file }}.patch
822- - name : Upload all patch files
823- if : ${{ steps.format_patch.outputs.has_patch == 'true' }}
824- uses : actions/upload-artifact@v4
825- with :
826- name : ${{ steps.format_patch.outputs.patch_file }}
827- path : |
828- whip-*.patch
829- retention-days : 90
830- runs-on : ubuntu-22.04
831-
832779 test-done :
833780 needs :
834781 - fate
@@ -841,7 +788,6 @@ jobs:
841788 - openssl-latest
842789 - gnutls
843790 - mbedtls
844- - generate-patch
845791 steps :
846792 - run : echo 'All done'
847793 runs-on : ubuntu-22.04
0 commit comments