Skip to content

Commit

Permalink
[BACKEND] Windows support (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbannon authored Mar 1, 2023
1 parent a2808fa commit 798bbbc
Show file tree
Hide file tree
Showing 29 changed files with 438 additions and 156 deletions.
125 changes: 125 additions & 0 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: ytld-sub CI (Windows)

on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test-unit:
runs-on: windows-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Run unit tests with coverage
run: |
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
python -m pip install -e .[test]
python -m pytest tests/unit
test-soundcloud:
runs-on: windows-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Run e2e soundcloud tests with coverage
run: |
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
python -m pip install -e .[test]
python -m pytest tests/e2e/soundcloud
test-bandcamp:
runs-on: windows-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Run e2e soundcloud tests with coverage
run: |
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
python -m pip install -e .[test]
python -m pytest tests/e2e/bandcamp
test-youtube:
runs-on: windows-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Run e2e youtube tests with coverage
run: |
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
python -m pip install -e .[test]
python -m pytest tests/e2e/youtube
test-plugins:
runs-on: windows-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Run e2e plugin tests with coverage
run: |
curl.exe -L -o ffmpeg.zip https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip
tar -xf ffmpeg.zip
move "ffmpeg-master-latest-win64-gpl\bin\ffmpeg.exe" "ffmpeg.exe"
move "ffmpeg-master-latest-win64-gpl\bin\ffprobe.exe" "ffprobe.exe"
python -m pip install -e .[test]
python -m pytest tests/e2e/plugins
86 changes: 25 additions & 61 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ytld-sub CI
name: ytld-sub CI (Linux)

on:
pull_request:
Expand All @@ -8,70 +8,42 @@ on:
branches:
- master
jobs:
test-build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m venv /opt/env
source /opt/env/bin/activate
pip install -e .[lint,test]
- name: Save Python build cache
uses: actions/cache@v3
with:
path: /opt/env
key: ${{github.sha}}-env

test-lint:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run linters
run: |
source /opt/env/bin/activate
pip install -e .[lint]
make check_lint
test-unit:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run unit tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
source /opt/env/bin/activate
coverage run -m pytest tests/unit && coverage xml -o /opt/coverage/unit/coverage.xml
- name: Save coverage
Expand All @@ -82,46 +54,42 @@ jobs:

test-soundcloud:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run e2e soundcloud tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
source /opt/env/bin/activate
coverage run -m pytest tests/e2e/soundcloud && coverage xml -o /opt/coverage/soundcloud/coverage.xml
test-bandcamp:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run e2e soundcloud tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
source /opt/env/bin/activate
coverage run -m pytest tests/e2e/bandcamp && coverage xml -o /opt/coverage/bandcamp/coverage.xml
- name: Save coverage
Expand All @@ -132,24 +100,22 @@ jobs:

test-youtube:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run e2e youtube tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
source /opt/env/bin/activate
coverage run -m pytest tests/e2e/youtube && coverage xml -o /opt/coverage/youtube/coverage.xml
- name: Save coverage
Expand All @@ -160,24 +126,22 @@ jobs:

test-plugins:
runs-on: ubuntu-22.04
needs: test-build
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Restore Python build cache
uses: actions/cache@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: /opt/env
key: ${{github.sha}}-env
python-version: "3.10"

- name: Run e2e plugin tests with coverage
run: |
pip install -e .[test]
sudo apt-get update
sudo apt-get install -y ffmpeg
source /opt/env/bin/activate
coverage run -m pytest tests/e2e/plugins && coverage xml -o /opt/coverage/plugins/coverage.xml
- name: Save coverage
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@ docker/*.whl
docker/root/*.whl
docker/root/defaults/examples

.local/
.local/

ffmpeg.exe
ffprobe.exe
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ maximum flexibility while maintaining simplicity.
![jelly_mv](https://user-images.githubusercontent.com/10107080/182677256-43aeb029-0c3f-4648-9fd2-352b9666b262.PNG)

### SoundCloud Albums and Singles
#### MusicBee (any file or tag-based music player)
#### MusicBee (any file or tag-based music players)
![sc_mb](https://user-images.githubusercontent.com/10107080/182685415-06adf477-3dd3-475d-bbcd-53b0152b9f0a.PNG)

### Bandcamp Discography
#### Navidrome (any file or tag-based music server)
#### Navidrome (any file or tag-based music servers)
![bc_nav](https://user-images.githubusercontent.com/10107080/212503861-1d8748e6-6f6d-4043-b543-84226cd1f662.png)


Expand Down Expand Up @@ -285,7 +285,7 @@ docker run -d \
Download and use our latest executable using the command below. For Windows users, use this method in
[WSL](https://learn.microsoft.com/en-us/windows/wsl/). FFmpeg is a required dependency.
```commandline
curl -L https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub > ytdl-sub
curl -L -o ytdl-sub https://github.com/jmbannon/ytdl-sub/releases/latest/download/ytdl-sub
chmod +x ytdl-sub
./ytdl-sub -h
```
Expand Down
Loading

0 comments on commit 798bbbc

Please sign in to comment.