Use poetry #78
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: Python package | |
on: [push] | |
env: | |
UNITTEST_RUN_SLOW_TESTS: "1" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v4 | |
- name: Setup a local virtual environment for caching | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v4 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ffmpeg espeak-ng libespeak-ng-dev | |
poetry install | |
# python -m pip install --upgrade pip | |
# pip install -r requirements.txt setuptools | |
- name: Build C/C++ extensions | |
# Disabled for the time being. | |
# FIXME: Calling C extensions inside GitHub action currently hangs. | |
if: ${{ false }} | |
run: | | |
cd aeneas/cdtw | |
make py | |
cd ../cengw | |
make py | |
cd ../cmfcc | |
make py | |
cd ../cwave | |
make py | |
- name: Run tests | |
run: | | |
poetry run python -m unittest discover -v |