From 0fdb9e93361d569b34e605054c12b442b8032f67 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Tue, 28 Feb 2023 15:04:24 -0800 Subject: [PATCH] simplified unix CI, make windows CI --- .github/workflows/ci-windows.yaml | 125 ++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 85 ++++++-------------- 2 files changed, 150 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/ci-windows.yaml diff --git a/.github/workflows/ci-windows.yaml b/.github/workflows/ci-windows.yaml new file mode 100644 index 00000000..e6073caa --- /dev/null +++ b/.github/workflows/ci-windows.yaml @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 00d2db55..a129b8bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: ytld-sub CI +name: ytld-sub CI (Linux) on: pull_request: @@ -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 @@ -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 @@ -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 @@ -167,17 +133,16 @@ jobs: 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