simplified unix CI, make windows CI

This commit is contained in:
Jesse Bannon 2023-02-28 15:04:24 -08:00
parent 8a3d92b04b
commit 0fdb9e9336
2 changed files with 150 additions and 60 deletions

125
.github/workflows/ci-windows.yaml vendored Normal file
View file

@ -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 -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 -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 -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 -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 -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

View file

@ -1,4 +1,4 @@
name: ytld-sub CI name: ytld-sub CI (Linux)
on: on:
pull_request: pull_request:
@ -8,70 +8,42 @@ on:
branches: branches:
- master - master
jobs: 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: test-lint:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: test-build
permissions: permissions:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run linters - name: Run linters
run: | run: |
source /opt/env/bin/activate pip install -e .[lint]
make check_lint make check_lint
test-unit: test-unit:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: test-build
permissions: permissions:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run unit tests with coverage - name: Run unit tests with coverage
run: | run: |
pip install -e .[test]
sudo apt-get update sudo apt-get update
sudo apt-get install -y ffmpeg 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 coverage run -m pytest tests/unit && coverage xml -o /opt/coverage/unit/coverage.xml
- name: Save coverage - name: Save coverage
@ -82,46 +54,42 @@ jobs:
test-soundcloud: test-soundcloud:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: test-build
permissions: permissions:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run e2e soundcloud tests with coverage - name: Run e2e soundcloud tests with coverage
run: | run: |
pip install -e .[test]
sudo apt-get update sudo apt-get update
sudo apt-get install -y ffmpeg 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 coverage run -m pytest tests/e2e/soundcloud && coverage xml -o /opt/coverage/soundcloud/coverage.xml
test-bandcamp: test-bandcamp:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: test-build
permissions: permissions:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run e2e soundcloud tests with coverage - name: Run e2e soundcloud tests with coverage
run: | run: |
pip install -e .[test]
sudo apt-get update sudo apt-get update
sudo apt-get install -y ffmpeg 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 coverage run -m pytest tests/e2e/bandcamp && coverage xml -o /opt/coverage/bandcamp/coverage.xml
- name: Save coverage - name: Save coverage
@ -132,24 +100,22 @@ jobs:
test-youtube: test-youtube:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: test-build
permissions: permissions:
contents: read contents: read
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run e2e youtube tests with coverage - name: Run e2e youtube tests with coverage
run: | run: |
pip install -e .[test]
sudo apt-get update sudo apt-get update
sudo apt-get install -y ffmpeg 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 coverage run -m pytest tests/e2e/youtube && coverage xml -o /opt/coverage/youtube/coverage.xml
- name: Save coverage - name: Save coverage
@ -167,17 +133,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Restore Python build cache - name: Set up Python
uses: actions/cache@v3 uses: actions/setup-python@v4
with: with:
path: /opt/env python-version: "3.10"
key: ${{github.sha}}-env
- name: Run e2e plugin tests with coverage - name: Run e2e plugin tests with coverage
run: | run: |
pip install -e .[test]
sudo apt-get update sudo apt-get update
sudo apt-get install -y ffmpeg 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 coverage run -m pytest tests/e2e/plugins && coverage xml -o /opt/coverage/plugins/coverage.xml
- name: Save coverage - name: Save coverage