Skip to content

Commit

Permalink
End-to-end test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism committed Sep 15, 2024
1 parent 214f524 commit 927adc6
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test
on:
workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
script-method:
name: Test plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download yt-dlp
run: curl -L https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest/download/yt-dlp -o yt-dlp
- name: Install and build server dependencies
run: cd server/ && yarn install --frozen-lockfile && npx tsc
- name: Install plugin
run: |
mkdir ~/yt-dlp-plugins && curl -L "https://github.com/coletdjnz/yt-dlp-get-pot/releases/download/v0.1.1/yt-dlp-get-pot.zip" -o ~/yt-dlp-plugins/yt-dlp-get-pot.zip
cp -aT plugin/ ~/yt-dlp-plugins/bgutil-ytdlp-pot-provider/
- name: Test script method
run: |
script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_script=server/build/generate_once.js")
echo $script_response
if [[ "$script_response" != *"BgUtilScriptPot: _get_pot_via_script response"* ]]; then
echo "BgUtilScriptPot was not invoked"
exit 1
fi
- name: Test server method
run: |
cd server/
node build/main.js&
script_response=$(./yt-dlp -vF --print-traffic BaW_jenozKc --extractor-args "youtube:getpot_bgutil_baseurl=http://127.0.0.1:4416")
echo $script_response
if [[ "$script_response" != *"BgUtilHTTPPot: Generating POT via HTTP server"* ]]; then
echo "BgUtilHTTPPot was not invoked"
exit 1
fi

0 comments on commit 927adc6

Please sign in to comment.