Dev #348
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
jobs: | ||
installation: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
python: ["3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@main | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Test installation | ||
run: | | ||
pip install "git+https://github.com/lewiswolf/kac_drumset.git" | ||
python3 -c "import kac_drumset" | ||
# - name: Test C++ deployment | ||
# run: | | ||
# python3 -c "import kac_drumset.externals._geometry" | ||
# python3 -c "import kac_drumset.externals._physics" | ||
all-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
python: ["3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: lukka/get-cmake@latest | ||
- uses: actions/setup-python@main | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- uses: actions/cache@v4 | ||
id: cache-pipenv | ||
with: | ||
path: ~/.local/share/virtualenvs | ||
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }} | ||
- name: Install OS specific dependencies | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: sudo apt-get install libsndfile1 | ||
- name: Install pipenv | ||
run: python -m pip install --upgrade pip pipenv setuptools wheel | ||
- name: Install python dependencies | ||
run: pipenv install -d --python ${{ matrix.python }} | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: pipenv run pip install soundfile | ||
- name: Build CPP | ||
run: pipenv run build | ||
- name: Lint project 3.11 | ||
if: ${{ matrix.python == '3.11' }} | ||
run: pipenv run flake8 --config=test/test.cfg | ||
- name: Lint project 3.12 | ||
if: ${{ matrix.python == '3.12' }} | ||
run: pipenv run flake8 --config=test/test.cfg --extend-ignore=Q000 | ||
- name: Assert types | ||
run: pipenv run mypy --config-file=test/test.cfg | ||
- name: Run unit tests | ||
run: pipenv run python test/test.py |