From 1fdcff31f8ac9b3a0b4d18028000d1bdb3137584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Voituret?= Date: Wed, 8 Jul 2020 15:50:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20add=20model=20and=20package=20ca?= =?UTF-8?q?che?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pypi.yml | 28 +++++++++++++++++++--------- .github/workflows/pytest.yml | 10 ++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 8f3e457..26a98c8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,19 +9,29 @@ env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} jobs: - deploy-cpu: + package-and-deploy: + strategy: + matrix: + platform: [cpu, gpu] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Package sdist + - name: Cache sdist packages + uses: actions/cache@v2 + env: + cache-name: cache-sdist-packages + with: + path: dist + key: sdist-${{ matrix.platform }}-${{ hashFiles('setup.py') }} + restore-keys: | + sdist-${{ matrix.platform }}-${{ hashFiles('setup.py') }} + sdist-${{ matrix.platform }} + sdist- + - if: ${{ matrix.platform }} == 'cpu' + name: Package CPU distribution run: make build - - name: Deploy to pypi - run: make deploy - deploy-gpu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Package sdist + - if: ${{ matrix.platform }} == 'gpu' + name: Package GPU distribution run: make build-gpu - name: Deploy to pypi run: make deploy \ No newline at end of file diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 49acfee..2b9019b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -14,6 +14,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Cache spleeter models + uses: actions/cache@v2 + env: + cache-name: cache-spleeter-model + with: + path: pretrained_models + key: models-${{ hashFiles('spleeter/model/__init__.py') }} + restore-keys: | + models-${{ hashFiles('spleeter/model/__init__.py') }} + models- - name: Install dependencies run: | sudo apt-get update && sudo apt-get install -y ffmpeg