- Update Ubuntu-based images to use Python 3.12 - Move hidden files from GUI image's main dir - Update github workflows to use python 3.12 - Update fixtures - Minor doc fixes
167 lines
No EOL
4.2 KiB
YAML
167 lines
No EOL
4.2 KiB
YAML
name: ytld-sub CI (Linux)
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
test-lint:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Run linters
|
|
run: |
|
|
pip install -e .[lint]
|
|
make check_lint
|
|
|
|
test-unit:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Run unit tests with coverage
|
|
run: |
|
|
pip install -e .[test]
|
|
sudo apt-get update
|
|
sudo apt-get install -y ffmpeg
|
|
coverage run -m pytest --reruns 3 --reruns-delay 5 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-integration:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Run integration tests with coverage
|
|
run: |
|
|
pip install -e .[test]
|
|
sudo apt-get update
|
|
sudo apt-get install -y ffmpeg
|
|
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/integration --ignore tests/integration/prebuilt_presets && coverage xml -o /opt/coverage/integration/coverage.xml
|
|
|
|
- name: Save coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/integration
|
|
key: ${{github.sha}}-coverage-integration
|
|
|
|
test-integration-prebuilt-presets:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Run prebuilt preset integration tests with coverage
|
|
run: |
|
|
pip install -e .[test]
|
|
sudo apt-get update
|
|
sudo apt-get install -y ffmpeg
|
|
coverage run -m pytest --reruns 3 --reruns-delay 5 tests/integration/prebuilt_presets && coverage xml -o /opt/coverage/integration-prebuilt-presets/coverage.xml
|
|
|
|
- name: Save coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/integration-prebuilt-presets
|
|
key: ${{github.sha}}-coverage-integration-prebuilt-presets
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Run e2e tests with coverage
|
|
run: |
|
|
pip install -e .[test]
|
|
sudo apt-get update
|
|
sudo apt-get install -y ffmpeg
|
|
coverage run -m pytest tests/e2e && coverage xml -o /opt/coverage/e2e/coverage.xml
|
|
|
|
codecov-upload:
|
|
runs-on: ubuntu-latest
|
|
needs: [
|
|
test-unit,
|
|
test-integration,
|
|
test-integration-prebuilt-presets,
|
|
test-e2e
|
|
]
|
|
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 integration test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/integration
|
|
key: ${{github.sha}}-coverage-integration
|
|
|
|
- name: Restore integration prebuilt presets test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/integration-prebuilt-presets
|
|
key: ${{github.sha}}-coverage-integration-prebuilt-presets
|
|
|
|
- name: Restore e2e test coverage
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /opt/coverage/e2e
|
|
key: ${{github.sha}}-coverage-e2e
|
|
|
|
- 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/integration/coverage.xml,/opt/coverage/integration-prebuilt-presets/coverage.xml,/opt/coverage/e2e/coverage.xml |