diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..44965f6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: Run Python Tests +on: + push: + branches: + - master + - tests + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Python 3 + run: | + sudo apt-get install python3 + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip install pytest + pip install -r requirements.txt + - name: Run tests with pytest + run: | + pytest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/README.md b/README.md index a11693f..e445371 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +[![Run Python Tests](https://github.com/davidedelvento/Numula/actions/workflows/ci.yml/badge.svg)](https://github.com/davidedelvento/Numula/actions/workflows/ci.yml) + + Numula: a Python library for creating nuanced music with MIDI. See [the Wiki](https://github.com/davidpanderson/Numula/wiki) diff --git a/examples/audio_test.py b/examples/audio_try.py similarity index 100% rename from examples/audio_test.py rename to examples/audio_try.py diff --git a/examples/curve_test.py b/examples/curve_try.py similarity index 100% rename from examples/curve_test.py rename to examples/curve_try.py diff --git a/examples/test_notate.py b/examples/test_notate.py index 6f6e9da..40026be 100644 --- a/examples/test_notate.py +++ b/examples/test_notate.py @@ -22,6 +22,6 @@ def test1(): ns = Score() ns.append_score([n(s)]) print(ns) - ns.write_midi('data/test1.midi') + ns.write_midi('./examples/data/test1.midi') test1() diff --git a/examples/test_note.py b/examples/test_note.py index 6f0a8f0..69efba5 100644 --- a/examples/test_note.py +++ b/examples/test_note.py @@ -20,7 +20,7 @@ def test1(): ns = Score(n('c d e f g a b c')) ns.insert_pedal(PedalUse(4/4, 3/4, True)) - ns.write_midi('data/test1.midi') + ns.write_midi('./examples/data/test1.midi') test1() diff --git a/examples/test_midifile.py b/examples/try_midifile.py similarity index 100% rename from examples/test_midifile.py rename to examples/try_midifile.py diff --git a/examples/test_nuance.py b/examples/try_nuance_pianoteq.py similarity index 100% rename from examples/test_nuance.py rename to examples/try_nuance_pianoteq.py diff --git a/pyproject.toml b/pyproject.toml index c1e1f36..8dc1335 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,3 +20,8 @@ classifiers = [ [project.urls] "Homepage" = "https://github.com/davidpanderson/Numula" "Bug Tracker" = "https://github.com/davidpanderson/Numula/issues" + +[tool.pytest.ini_options] +pythonpath = [ + "." +] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6bdca25 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +numpy +mido