|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
7 | | - pull_request: |
8 | | - branches: |
9 | | - - master |
10 | | - |
11 | | -env: |
12 | | - MAIN_PYTHON_VERSION: "3.12" |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
13 | 10 |
|
14 | 11 | jobs: |
15 | | - test: |
16 | | - name: "${{ matrix.os }}: ${{ matrix.python-version }}" |
17 | | - runs-on: ${{ matrix.os }} |
18 | | - strategy: |
19 | | - fail-fast: false |
20 | | - matrix: |
21 | | - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
22 | | - os: [ubuntu-24.04, windows-latest] |
| 12 | + test: |
| 13 | + name: "${{ matrix.os }}: ${{ matrix.tox-env }}" |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + tox-env: |
| 19 | + [ |
| 20 | + py39-test, |
| 21 | + py310-test, |
| 22 | + py311-test, |
| 23 | + py312-test, |
| 24 | + py313-test, |
| 25 | + pypy-test, |
| 26 | + ] |
| 27 | + os: [ubuntu-24.04, windows-latest] |
| 28 | + |
| 29 | + # Only test on a couple of versions on Windows. |
| 30 | + exclude: |
| 31 | + - os: windows-latest |
| 32 | + tox-env: pypy-test |
23 | 33 |
|
24 | | - steps: |
25 | | - - uses: actions/checkout@v5 |
26 | | - - name: Set up Python ${{ matrix.python-version }} |
27 | | - uses: actions/setup-python@v5 |
28 | | - with: |
29 | | - python-version: ${{ matrix.python-version }} |
30 | | - - name: Install dependencies |
31 | | - run: | |
32 | | - python -m pip install --upgrade pip |
33 | | - pip install .[dev] |
34 | 34 |
|
35 | | - - name: Run tests |
36 | | - run: | |
37 | | - pytest -v --cov=mediafile --cov=mediafile --cov-report=xml --cov-report=html test/ |
38 | | - - name: Upload coverage reports |
39 | | - if: matrix.os == 'ubuntu-24.04' && matrix.python-version == env.MAIN_PYTHON_VERSION |
40 | | - uses: actions/upload-artifact@v4 |
41 | | - with: |
42 | | - name: coverage-${{ github.run_id }} |
43 | | - path: htmlcov/ |
44 | | - retention-days: 30 |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v3 |
| 37 | + - name: Set up Python ${{ matrix.python }} |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python }} |
| 41 | + - name: Install Tox |
| 42 | + run: pip install tox |
| 43 | + - name: Tox |
| 44 | + run: tox -e ${{ matrix.tox-env }} |
45 | 45 |
|
46 | | - style: |
47 | | - name: Style |
48 | | - runs-on: ubuntu-latest |
49 | | - steps: |
50 | | - - uses: actions/checkout@v5 |
51 | | - - name: Set up Python ${{ env.MAIN_PYTHON_VERSION }} |
52 | | - uses: actions/setup-python@v5 |
53 | | - with: |
54 | | - python-version: ${{ env.MAIN_PYTHON_VERSION }} |
55 | | - - name: Install dependencies |
56 | | - run: | |
57 | | - python -m pip install --upgrade pip |
58 | | - pip install .[dev] |
59 | | - - name: Check style with Ruff |
60 | | - run: | |
61 | | - ruff check --output-format=github . |
62 | | - - name: Check format with Ruff |
63 | | - run: | |
64 | | - ruff format --check . |
| 46 | + style: |
| 47 | + name: Style |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - name: Install Python |
| 52 | + uses: actions/setup-python@v5 |
| 53 | + with: |
| 54 | + python-version: "3.9" |
| 55 | + - name: Install dependencies |
| 56 | + run: | |
| 57 | + python -m pip install --upgrade pip |
| 58 | + pip install .[dev] |
| 59 | + - name: Check style with Ruff |
| 60 | + id: ruff |
| 61 | + run: | |
| 62 | + ruff check --output-format=github . |
| 63 | + - name: Check format with Ruff |
| 64 | + id: ruff-format |
| 65 | + run: | |
| 66 | + ruff format --check . |
0 commit comments