Files
spleeter/.circleci/config.yml
Félix Voituret ebd03c8565 fix: cache keys
2019-11-08 19:38:20 -05:00

106 lines
3.5 KiB
YAML

version: 2
jobs:
# =======================================================================================
# Python 3.6 testing.
# =======================================================================================
test-3.6:
docker:
- image: python:3.6
working_directory: ~/spleeter
steps:
- checkout
- restore_cache:
keys:
- python-3.6-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}
- python-3.6-cache-{{ .Branch }}-
- python-3.6-cache-
- run:
name: install ffmpeg
command: apt-get update && apt-get install -y ffmpeg
- run:
name: install python dependencies
command: pip install -r requirements.txt && pip install pytest
- save_cache:
key: python-3.6-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "pretrained_models"
- "/usr/local/bin"
- "/usr/local/lib/python3.6/site-packages"
- run:
name: pytest
command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning
# =======================================================================================
# Python 3.7 testing.
# =======================================================================================
test-3.7:
docker:
- image: python:3.7
working_directory: ~/spleeter
steps:
- checkout
- restore_cache:
keys:
- python-3.7-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}
- python-3.7-cache-{{ .Branch }}-
- python-3.7-cache-
- run:
name: install ffmpeg
command: apt-get update && apt-get install -y ffmpeg
- run:
name: install python dependencies
command: pip install -r requirements.txt && pip install pytest
- run:
name: pytest
command: pytest -W ignore::FutureWarning -W ignore::DeprecationWarning
- save_cache:
key: python-3.7-cache-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- "pretrained_models"
- "/usr/local/bin"
- "/usr/local/lib/python3.7/site-packages"
# =======================================================================================
# Source distribution packaging.
# =======================================================================================
sdist:
docker:
- image: python:3
steps:
- checkout
- run:
name: package
command: python setup.py sdist
- save_cache:
key: sdist-{{ .Branch }}-{{ checksum "setup.py" }}
paths:
- dist
# =======================================================================================
# PyPi deployment.
# =======================================================================================
pypi-deploy:
docker:
- image: python:3
steps:
- checkout
- restore_cache:
key: sdist-{{ .Branch }}-{{ checksum "setup.py" }}
- run:
name: upload to PyPi
command: pip install twine && twine upload dist/*
workflows:
version: 2
test-and-deploy:
jobs:
- test-3.6
- test-3.7
- sdist:
requires:
- test-3.6
- test-3.7
- pypi-deploy:
filters:
branches:
only:
- master
- development
requires:
- sdist