| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
name: Tests |
| 6 |
|
| 7 |
on: |
| 8 |
pull_request: |
| 9 |
branches: |
| 10 |
- main |
| 11 |
push: |
| 12 |
branches-ignore: |
| 13 |
- gh-pages |
| 14 |
workflow_dispatch: |
| 15 |
|
| 16 |
jobs: |
| 17 |
|
| 18 |
style: |
| 19 |
runs-on: ubuntu-latest |
| 20 |
steps: |
| 21 |
- name: Checkout |
| 22 |
uses: actions/checkout@v3 |
| 23 |
- name: Set up Python |
| 24 |
uses: actions/setup-python@v4 |
| 25 |
with: |
| 26 |
python-version-file: 'pyproject.toml' |
| 27 |
cache: 'pip' |
| 28 |
- name: Upgrade pip |
| 29 |
run: python3 -m pip install --upgrade pip setuptools wheel |
| 30 |
- name: Install mido in dev mode |
| 31 |
run: python3 -m pip install --quiet .[lint-code] |
| 32 |
- name: Lint code with ruff |
| 33 |
run: ruff check . |
| 34 |
env: |
| 35 |
RUFF_OUTPUT_FORMAT: github |
| 36 |
|
| 37 |
reuse: |
| 38 |
runs-on: ubuntu-latest |
| 39 |
steps: |
| 40 |
- name: Checkout |
| 41 |
uses: actions/checkout@v3 |
| 42 |
- name: Set up Python |
| 43 |
uses: actions/setup-python@v4 |
| 44 |
with: |
| 45 |
python-version-file: 'pyproject.toml' |
| 46 |
cache: 'pip' |
| 47 |
- name: Upgrade pip |
| 48 |
run: python3 -m pip install --upgrade pip setuptools wheel |
| 49 |
- name: Install mido in dev mode |
| 50 |
run: python3 -m pip install --quiet .[lint-reuse] |
| 51 |
- name: Lint reuse |
| 52 |
run: reuse lint |
| 53 |
|
| 54 |
manifest: |
| 55 |
runs-on: ubuntu-latest |
| 56 |
steps: |
| 57 |
- name: Checkout |
| 58 |
uses: actions/checkout@v3 |
| 59 |
- name: Set up Python |
| 60 |
uses: actions/setup-python@v4 |
| 61 |
with: |
| 62 |
python-version-file: 'pyproject.toml' |
| 63 |
cache: 'pip' |
| 64 |
- name: Upgrade pip |
| 65 |
run: python3 -m pip install --upgrade pip setuptools wheel |
| 66 |
- name: Install mido in dev mode |
| 67 |
run: python3 -m pip install --quiet .[check-manifest] |
| 68 |
- name: Check manifest is complete |
| 69 |
run: check-manifest --verbose |
| 70 |
|
| 71 |
docs: |
| 72 |
runs-on: ubuntu-latest |
| 73 |
steps: |
| 74 |
- name: Checkout |
| 75 |
uses: actions/checkout@v3 |
| 76 |
- name: Set up Python |
| 77 |
uses: actions/setup-python@v4 |
| 78 |
with: |
| 79 |
python-version-file: 'pyproject.toml' |
| 80 |
cache: 'pip' |
| 81 |
- name: Upgrade pip |
| 82 |
run: python3 -m pip install --upgrade pip setuptools wheel |
| 83 |
- name: Install mido in dev mode |
| 84 |
run: python3 -m pip install --quiet .[build-docs] |
| 85 |
- name: Check documentation |
| 86 |
run: sphinx-build -b linkcheck -j auto -q -W -E --keep-going docs docs/_build |
| 87 |
|
| 88 |
test: |
| 89 |
needs: |
| 90 |
- docs |
| 91 |
- manifest |
| 92 |
- reuse |
| 93 |
- style |
| 94 |
runs-on: ${{ matrix.os }} |
| 95 |
strategy: |
| 96 |
matrix: |
| 97 |
os: |
| 98 |
- macOS-latest |
| 99 |
- ubuntu-latest |
| 100 |
- windows-latest |
| 101 |
python-version: |
| 102 |
- '3.7' |
| 103 |
- '3.8' |
| 104 |
- '3.9' |
| 105 |
- '3.10' |
| 106 |
- '3.11' |
| 107 |
- '3.12' |
| 108 |
- '3.13' |
| 109 |
exclude: |
| 110 |
- python-version: "3.7" |
| 111 |
os: macOS-latest |
| 112 |
include: |
| 113 |
- python-version: "3.7" |
| 114 |
os: macOS-13 |
| 115 |
steps: |
| 116 |
- name: Checkout |
| 117 |
uses: actions/checkout@v3 |
| 118 |
- name: Set up Python ${{ matrix.python-version }} |
| 119 |
uses: actions/setup-python@v4 |
| 120 |
with: |
| 121 |
python-version: ${{ matrix.python-version }} |
| 122 |
cache: 'pip' |
| 123 |
- name: Upgrade pip |
| 124 |
run: python3 -m pip install --upgrade pip setuptools wheel |
| 125 |
- name: Install mido in dev mode |
| 126 |
run: python3 -m pip install --quiet .[test-code] |
| 127 |
- name: Test with pytest |
| 128 |
run: pytest |