Skip to content

Tweaks for madderscientist change #93

Tweaks for madderscientist change

Tweaks for madderscientist change #93

Workflow file for this run

name: ci
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [created] # Only publish on tagged releases
jobs:
codespell_and_ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v2
- run: pipx run 'codespell[toml]' **/*.py **/*.txt --skip="venv/lib/python3*"
ci:
needs: [codespell_and_ruff]
strategy:
fail-fast: false
max-parallel: 4
matrix: # macos-13 in Intel, macos-latest is Apple Silicon ARM
os: [macos-13, macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: 3.13}
- if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install fluidsynth python3-pyaudio portaudio19-dev libasound-dev
- if: runner.os == 'macOS'
run: |
brew install fluid-synth
echo "DYLD_LIBRARY_PATH=$(brew --prefix fluid-synth)/lib/" >> $GITHUB_ENV
- run: python -m pip install --upgrade pip
- run: pip install pyaudio
- run: pip install --editable .
- if: runner.os == 'Windows'
run: choco install fluidsynth
- shell: python
run: |
import fluidsynth
print(fluidsynth)
print(dir(fluidsynth))
# NOTE: The files in test/ are NOT unit tests or pytests.
# On macOS ARM64 the following tests will pass but each takes 8 minutes to run.
# On macOS X64 all tests will pass quickly.
- if: runner.os == 'macOS' && runner.arch == 'X64'
run: |
python test/test1.py
python test/test2.py
python test/test3.py
python test/sequencerTest.py
- if: runner.os == 'Linux'
run: |
python test/test1.py
python test/test3.py
python test/sequencerTest.py
# On Windows all tests will pass quickly.
- if: runner.os == 'Windows'
run: |
python test/test1.py
python test/test2.py
python test/test3.py
python test/sequencerTest.py
build:
needs: [ci]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install build twine
- name: Clean previous builds
run: |
rm -rf dist
- name: Build package
run: |
python -m build
python -m twine check --strict dist/*
ls -la dist
- name: Upload dist directory as artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
pypi-publish:
needs: [build]
name: upload release to PyPI
if: github.event_name == 'release' && github.event.action == 'created' # Only on release creation
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- run: ls -la
- run: ls -la dist || true
- uses: pypa/gh-action-pypi-publish@release/v1