* [BUGFIX] Fix missing contains function when checking entries * remove children func * [BACKEND] Bandcamp e2e test, update music example * WIP * combine soundcloud and all music into music_audio config * sc fixtures * updated tests and examples * bandcamp e2e test * regen off * remove url validators * use bandcamp artist url for more parent coverage * lint
236 lines
No EOL
5.7 KiB
YAML
236 lines
No EOL
5.7 KiB
YAML
name: ytld-sub CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run linters
|
|
run: |
|
|
source /opt/env/bin/activate
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run unit tests with coverage
|
|
run: |
|
|
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
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/unit
|
|
key: ${{github.sha}}-coverage-unit
|
|
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run e2e soundcloud tests with coverage
|
|
run: |
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run e2e soundcloud tests with coverage
|
|
run: |
|
|
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
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/bandcamp
|
|
key: ${{github.sha}}-coverage-bandcamp
|
|
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run e2e youtube tests with coverage
|
|
run: |
|
|
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
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/youtube
|
|
key: ${{github.sha}}-coverage-youtube
|
|
|
|
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
|
|
with:
|
|
path: /opt/env
|
|
key: ${{github.sha}}-env
|
|
|
|
- name: Run e2e plugin tests with coverage
|
|
run: |
|
|
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
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/plugins
|
|
key: ${{github.sha}}-coverage-plugins
|
|
|
|
codecov-upload:
|
|
runs-on: ubuntu-22.04
|
|
needs: [
|
|
test-unit,
|
|
test-soundcloud,
|
|
test-bandcamp,
|
|
test-youtube,
|
|
test-plugins
|
|
]
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Restore unit test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/unit
|
|
key: ${{github.sha}}-coverage-unit
|
|
|
|
- name: Restore soundcloud test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/soundcloud
|
|
key: ${{github.sha}}-coverage-soundcloud
|
|
|
|
- name: Restore bandcamp test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/bandcamp
|
|
key: ${{github.sha}}-coverage-bandcamp
|
|
|
|
- name: Restore youtube test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/youtube
|
|
key: ${{github.sha}}-coverage-youtube
|
|
|
|
- name: Restore plugins test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/plugins
|
|
key: ${{github.sha}}-coverage-plugins
|
|
|
|
- name: Upload code coverage to codecov.io
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: /opt/coverage/unit/coverage.xml,/opt/coverage/soundcloud/coverage.xml,/opt/coverage/bandcamp/coverage.xml,/opt/coverage/youtube/coverage.xml,/opt/coverage/plugins/coverage.xml |