Skip to content

Commit

Permalink
continuous integration on GitHub for Linux/MacOS/Windows (bootphon#80)
Browse files Browse the repository at this point in the history
Also:
- bugfix with festival backend on Windows
- fixed some tests on Windows
  • Loading branch information
Mathieu Bernard authored Sep 29, 2021
1 parent bb52397 commit 700e06f
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 142 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Test on Linux Ubuntu with festival-2.5 with various Python and espeak versions

name: Linux

on: [push, pull_request]

jobs:
python-version:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

steps:
- name: Checkout phonemizer
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: sudo apt-get install espeak-ng festival mbrola mbrola-fr1

- name: Install phonemizer
run: |
pip install --upgrade pip pytest pytest-cov
python setup.py install
- name: Version phonemizer
run: phonemize --version

- name: Test phonemizer
run: pytest -v --cov=phonemizer --cov-report=xml test/

- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v2
with:
files: coverage.xml
verbose: true

espeak-version:
runs-on: ubuntu-latest

strategy:
matrix:
espeak-version: ['1.48.03', '1.49.2', '1.50', 'master']

steps:
- name: Checkout phonemizer
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2

- name: Install system dependencies
run: sudo apt-get install festival mbrola mbrola-fr1

- name: Install espeak-1.48
if: ${{ matrix.espeak-version == '1.48.03' }}
run: sudo apt install espeak

- name: Install espeak>=1.49
if: ${{ matrix.espeak-version != '1.48.03' }}
env:
ESPEAK_VERSION: ${{ matrix.espeak-version }}
run: |
sudo apt-get install make autoconf automake libtool pkg-config gcc libsonic-dev libpcaudio-dev git
git clone --depth 1 --branch $ESPEAK_VERSION https://github.com/espeak-ng/espeak-ng.git
cd espeak-ng
./autogen.sh
./configure
make
sudo make install
sudo ldconfig
espeak --version
- name: Install phonemizer
run: |
pip install --upgrade pip pytest
python setup.py install
- name: Version phonemizer
run: phonemize --version

- name: Test phonemizer
run: pytest -v
57 changes: 57 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Test on macos with festival-2.4 compiled from source and espeak-1.48 from
# homebrew. To save time and ressources, festival is cached across runs.

name: MacOS

on: [push, pull_request]

jobs:
test:
runs-on: macos-latest

env:
PHONEMIZER_FESTIVAL_PATH: ${{ github.workspace }}/festival/build_festival/festival/bin/festival

steps:
- name: Checkout phonemizer
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2

- name: Install espeak-1.48
run: |
brew update
brew install espeak
- name: Cache festival
uses: actions/cache@v2
id: cache-festival
with:
path: ${{ github.workspace }}/festival
key: ${{ runner.os }}-festival

- name: Checkout festival
if: steps.cache-festival.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: pettarin/setup-festival-mbrola
path: festival

- name: Install festival
if: steps.cache-festival.outputs.cache-hit != 'true'
run: |
cd festival
bash setup_festival_mbrola.sh . festival
- name: Install phonemizer
run: |
pip install --upgrade pip
python setup.py install
pip install --upgrade pytest
- name: Version phonemizer
run: phonemize --version

- name: Test phonemizer
run: pytest -v
35 changes: 35 additions & 0 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Uppload to pypi on new tags

name: Publish to Pypi

on:
push:
tags: v*
branches: master

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout phonemizer
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2

- name: Install system dependencies
run: sudo apt-get install espeak-ng festival mbrola mbrola-fr1

- name: Build phonemizer
run: |
pip install --upgrade pip pytest
python setup.py install
pytest
python setup.py sdist bdist_wheel
- name: Publish to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Test on windows with espeak-1.50 and festival-2.5

name: Windows

on: [push, pull_request]

jobs:
test:
runs-on: windows-latest

env:
PHONEMIZER_ESPEAK_PATH: "C:\\Program Files\\eSpeak NG\\espeak-ng.exe"
PHONEMIZER_FESTIVAL_PATH: "C:\\festival\\src\\main\\festival.exe"

steps:
- name: Checkout phonemizer
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2

- name: Cache festival
uses: actions/cache@v2
id: cache-festival
with:
path: |
C:\festival
C:\speech_tools
key: ${{ runner.os }}-festival

- name: Install espeak
if: steps.cache-espeak.outputs.cache-hit != 'true'
run: |
$source = 'https://github.com/espeak-ng/espeak-ng/releases/download/1.50/espeak-ng-20191129-b702b03-x64.msi'
Invoke-WebRequest -Uri $source -OutFile espeak.msi
Start-Process msiexec.exe -Wait -ArgumentList '/I espeak.msi /qn'
- name: Install festival
if: steps.cache-festival.outputs.cache-hit != 'true'
run: |
$uri = "https://sourceforge.net/projects/e-guidedog/files/related-third-party-software/0.3"
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile("$uri" + "/festival-2.5-win.7z", "festival-2.5.7z")
$webclient.DownloadFile("$uri" + "/speech_tools-2.5-win.7z", "speech_tools-2.5.7z")
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
sz x -oC:\ festival-2.5.7z
sz x -oC:\ speech_tools-2.5.7z
- name: Install phonemizer
run: |
pip install --upgrade pip pytest
python setup.py install
- name: Version phonemizer
run: |
phonemize --version
- name: Test phonemizer
run: pytest -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/build/*
/dist/*
.coverage*
coverage.xml
htmlcov/*
.eggs/*
test/htmlcov
68 changes: 0 additions & 68 deletions .gitlab-ci.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[![Build Status](https://travis-ci.com/bootphon/phonemizer.svg?branch=master)](
https://travis-ci.com/bootphon/phonemizer)
[![Linux](https://github.com/bootphon/phonemizer/actions/workflows/linux.yaml/badge.svg?branch=master)](
https://github.com/bootphon/phonemizer/actions/workflows/linux.yaml)
[![MacOS](https://github.com/bootphon/phonemizer/actions/workflows/macos.yaml/badge.svg?branch=master)](
https://github.com/bootphon/phonemizer/actions/workflows/macos.yaml)
[![Windows](https://github.com/bootphon/phonemizer/actions/workflows/windows.yaml/badge.svg?branch=master)](
https://github.com/bootphon/phonemizer/actions/workflows/windows.yaml)
[![Codecov](https://img.shields.io/codecov/c/github/bootphon/phonemizer)](
https://codecov.io/gh/bootphon/phonemizer)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/bootphon/phonemizer)](
https://codecov.io/gh/bootphon/phonemizer) [![GitHub release (latest
SemVer)](https://img.shields.io/github/v/release/bootphon/phonemizer)](
https://github.com/bootphon/phonemizer/releases/latest)
[![DOI](https://zenodo.org/badge/56728069.svg)](
https://doi.org/10.5281/zenodo.1045825)
Expand Down
Loading

0 comments on commit 700e06f

Please sign in to comment.