Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 56 additions & 72 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,64 @@
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: "${{ matrix.os }}: ${{ matrix.tox-env }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
tox-env:
[
py39-test,
py310-test,
py311-test,
py312-test,
py313-test,
pypy-test,
]
os: [ubuntu-24.04, windows-latest]
env:
MAIN_PYTHON_VERSION: "3.12"

# Only test on a couple of versions on Windows.
exclude:
- os: windows-latest
tox-env: pypy-test
jobs:
test:
name: "${{ matrix.os }}: ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-24.04, windows-latest]

# Python interpreter versions. :/
include:
- tox-env: py39-test
python: "3.9"
- tox-env: py310-test
python: "3.10"
- tox-env: py311-test
python: "3.11"
- tox-env: py312-test
python: "3.12"
- tox-env: py313-test
python: "3.13"
- tox-env: pypy-test
python: pypy3.9
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox
run: pip install tox
- name: Tox
run: tox -e ${{ matrix.tox-env }}
- name: Run tests
run: |
pytest -v --cov=mediafile --cov=mediafile --cov-report=xml --cov-report=html test/
- name: Upload coverage reports
if: matrix.os == 'ubuntu-24.04' && matrix.python-version == env.MAIN_PYTHON_VERSION
uses: actions/upload-artifact@v4
with:
name: coverage-${{ github.run_id }}
path: htmlcov/
retention-days: 30

style:
name: Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Check style with Ruff
id: ruff
run: |
ruff check --output-format=github .
- name: Check format with Ruff
id: ruff-format
run: |
ruff format --check .
style:
name: Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Check style with Ruff
run: |
ruff check --output-format=github .
- name: Check format with Ruff
run: |
ruff format --check .
Loading