Skip to content

Merge branch 'stable' #563

Merge branch 'stable'

Merge branch 'stable' #563

Workflow file for this run

name: CI
on:
push:
branches-ignore:
- 'dependabot/**'
- 'pre-commit-ci-update-config'
pull_request:
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
name: Test • Python ${{ matrix.python-version }} • ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip
pip install .[music-notation]
- name: Install PortAudio and LilyPond (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install libportaudio2 lilypond
- name: Install LilyPond (macOS)
if: contains(matrix.os, 'macos')
run: |
brew install lilypond
- name: Install LilyPond (Windows)
if: contains(matrix.os, 'windows')
run: |
choco install lilypond
echo "C:\Program Files (x86)\LilyPond\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install test requirements
run: |
pip install -r tests/requirements.txt
pip install pytest-github-actions-annotate-failures
- name: Run tests with pytest
id: pytest
run: |
pytest ${{ matrix.python-version == '3.11' && '--mpl --mpl-results-path=pytest_mpl_results/ --mpl-generate-summary=html' || '' }}
- name: Upload pytest-mpl results
if: failure() && matrix.python-version == '3.11' && steps.pytest.conclusion == 'failure'
uses: actions/upload-artifact@v4
with:
name: pytest-mpl-results-${{ runner.os }}${{ matrix.os == 'macos-latest' && '_arm64' || '' }}
path: pytest_mpl_results/
- name: Run doctests with pytest
run: |
pytest --doctest-modules thebeat/
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install package
run: |
python -m pip install --upgrade pip
pip install .[music-notation]
- name: Install PortAudio, PulseAudio, and D-Bus
run: |
sudo apt update
sudo apt install libportaudio2 pulseaudio dbus-x11
- name: Install documentation requirements
run: |
sudo apt install pandoc
pip install -r docs/requirements.txt
pip install nbconvert
- name: Clear example outputs
run: |
find docs/source -type f -name "*.ipynb" | xargs jupyter nbconvert --clear-output --inplace
- name: Build documentation
run: |
dbus-launch pulseaudio --start # See LABSN/sound-ci-helpers
export PYDEVD_DISABLE_FILE_VALIDATION=1
cd docs
make html