From fd3b0e6f4f1eba2f7fb3dab23ccda40123485341 Mon Sep 17 00:00:00 2001 From: WeberJulian Date: Fri, 24 Jun 2022 16:54:50 +0200 Subject: [PATCH] Add back other actions --- .github/workflows/aux_tests.yml | 49 ++++++++++++++++++++ .github/workflows/data_tests.yml | 49 ++++++++++++++++++++ .github/workflows/docker.yaml | 65 +++++++++++++++++++++++++++ .github/workflows/inference_tests.yml | 49 ++++++++++++++++++++ .github/workflows/pypi-release.yml | 29 +++++++----- .github/workflows/style_check.yml | 47 +++++++++++++++++++ .github/workflows/text_tests.yml | 48 ++++++++++++++++++++ .github/workflows/tts_tests.yml | 51 +++++++++++++++++++++ .github/workflows/vocoder_tests.yml | 46 +++++++++++++++++++ .github/workflows/zoo_tests.yml | 50 +++++++++++++++++++++ 10 files changed, 473 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/aux_tests.yml create mode 100644 .github/workflows/data_tests.yml create mode 100644 .github/workflows/docker.yaml create mode 100644 .github/workflows/inference_tests.yml create mode 100644 .github/workflows/style_check.yml create mode 100644 .github/workflows/text_tests.yml create mode 100644 .github/workflows/tts_tests.yml create mode 100644 .github/workflows/vocoder_tests.yml create mode 100644 .github/workflows/zoo_tests.yml diff --git a/.github/workflows/aux_tests.yml b/.github/workflows/aux_tests.yml new file mode 100644 index 00000000..d7eaf5c1 --- /dev/null +++ b/.github/workflows/aux_tests.yml @@ -0,0 +1,49 @@ +name: aux-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git make gcc + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Replace scarf urls + run: | + sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make test_aux diff --git a/.github/workflows/data_tests.yml b/.github/workflows/data_tests.yml new file mode 100644 index 00000000..22fdf98c --- /dev/null +++ b/.github/workflows/data_tests.yml @@ -0,0 +1,49 @@ +name: data-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git make gcc + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Replace scarf urls + run: | + sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make data_tests diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 00000000..7d383f3f --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,65 @@ +name: "Docker build and push" +on: + pull_request: + push: + branches: + - main + - dev + tags: + - v* +jobs: + docker-build: + name: "Build and push Docker image" + runs-on: ubuntu-20.04 + strategy: + matrix: + arch: ["amd64"] + base: + - "nvcr.io/nvidia/pytorch:22.03-py3" # GPU enabled + - "ubuntu:20.04" # CPU only + steps: + - uses: actions/checkout@v2 + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute Docker tags, check VERSION file matches tag + id: compute-tag + run: | + set -ex + base="ghcr.io/coqui-ai/tts" + tags="" # PR build + + if [[ ${{ matrix.base }} = "ubuntu:20.04" ]]; then + base="ghcr.io/coqui-ai/tts-cpu" + fi + + if [[ "${{ startsWith(github.ref, 'refs/heads/') }}" = "true" ]]; then + # Push to branch + github_ref="${{ github.ref }}" + branch=${github_ref#*refs/heads/} # strip prefix to get branch name + tags="${base}:${branch},${base}:${{ github.sha }}," + elif [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]]; then + VERSION="v$(cat TTS/VERSION)" + if [[ "${{ github.ref }}" != "refs/tags/${VERSION}" ]]; then + echo "Pushed tag does not match VERSION file. Aborting push." + exit 1 + fi + tags="${base}:${VERSION},${base}:latest,${base}:${{ github.sha }}" + fi + echo "::set-output name=tags::${tags}" + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/${{ matrix.arch }} + push: ${{ github.event_name == 'push' }} + build-args: "BASE=${{ matrix.base }}" + tags: ${{ steps.compute-tag.outputs.tags }} diff --git a/.github/workflows/inference_tests.yml b/.github/workflows/inference_tests.yml new file mode 100644 index 00000000..8e216f50 --- /dev/null +++ b/.github/workflows/inference_tests.yml @@ -0,0 +1,49 @@ +name: inference_tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git make gcc + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Replace scarf urls + run: | + sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make inference_tests diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 314dbb13..ac0f478b 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -1,6 +1,6 @@ name: Publish Python 🐍 distributions 📦 to PyPI on: - pull_request: + pull_request: #TO DELETE release: types: [published] defaults: @@ -10,16 +10,13 @@ defaults: jobs: build-sdist: runs-on: ubuntu-20.04 - steps: + steps: #Add back version test - uses: actions/checkout@v2 - name: Verify tag matches version run: | set -ex version=$(cat TTS/VERSION) tag="${GITHUB_REF/refs\/tags\/}" - if [[ "v$version" != "v$version" ]]; then - exit 1 - fi - uses: actions/setup-python@v2 with: python-version: 3.8 @@ -37,24 +34,24 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.7"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install pip requirements - run: | python -m pip install -U pip setuptools wheel build - # - name: Build manylinux Python wheels - # uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64 - # with: - # python-versions: 'cp37-cp37m' - run: python -m pip install -r requirements.txt + - name: Build manylinux wheel - run: python setup.py bdist_wheel --plat-name=manylinux1_x86_64 + - name: Install manylinux wheel - run: | python -m pip install dist/*-manylinux*.whl + - name: Upload manylinux wheel - uses: actions/upload-artifact@v2 with: name: wheel-${{ matrix.python-version }} @@ -73,5 +70,17 @@ jobs: with: name: "wheel-3.7" path: "dist/" + - uses: actions/download-artifact@v2 + with: + name: "wheel-3.8" + path: "dist/" + - uses: actions/download-artifact@v2 + with: + name: "wheel-3.9" + path: "dist/" + - uses: actions/download-artifact@v2 + with: + name: "wheel-3.10" + path: "dist/" - run: | ls -lh dist/ diff --git a/.github/workflows/style_check.yml b/.github/workflows/style_check.yml new file mode 100644 index 00000000..8d1e1af4 --- /dev/null +++ b/.github/workflows/style_check.yml @@ -0,0 +1,47 @@ +name: style-check + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.9] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git make gcc + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Lint check + run: | + make lint \ No newline at end of file diff --git a/.github/workflows/text_tests.yml b/.github/workflows/text_tests.yml new file mode 100644 index 00000000..87a0658d --- /dev/null +++ b/.github/workflows/text_tests.yml @@ -0,0 +1,48 @@ +name: text-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git make gcc + sudo apt-get install espeak + sudo apt-get install espeak-ng + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make test_text diff --git a/.github/workflows/tts_tests.yml b/.github/workflows/tts_tests.yml new file mode 100644 index 00000000..69ec955a --- /dev/null +++ b/.github/workflows/tts_tests.yml @@ -0,0 +1,51 @@ +name: tts-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends git make gcc + sudo apt-get install espeak + sudo apt-get install espeak-ng + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Replace scarf urls + run: | + sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make test_tts diff --git a/.github/workflows/vocoder_tests.yml b/.github/workflows/vocoder_tests.yml new file mode 100644 index 00000000..e1e619b6 --- /dev/null +++ b/.github/workflows/vocoder_tests.yml @@ -0,0 +1,46 @@ +name: vocoder-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git make gcc + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make test_vocoder diff --git a/.github/workflows/zoo_tests.yml b/.github/workflows/zoo_tests.yml new file mode 100644 index 00000000..eaa12fe3 --- /dev/null +++ b/.github/workflows/zoo_tests.yml @@ -0,0 +1,50 @@ +name: zoo-tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + check_skip: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + experimental: [false] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: coqui-ai/setup-python@pip-cache-key-py-ver + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements*' + - name: check OS + run: cat /etc/os-release + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y git make gcc + sudo apt-get install espeak espeak-ng + make system-deps + - name: Install/upgrade Python setup deps + run: python3 -m pip install --upgrade pip setuptools wheel + - name: Replace scarf urls + run: | + sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json + - name: Install TTS + run: | + python3 -m pip install .[all] + python3 setup.py egg_info + - name: Unit tests + run: make test_zoo