Files
spleeter/.circleci/config.yml
Félix Voituret 326fc323d1 fix: worflow
2019-11-19 11:54:24 +01:00

322 lines
9.4 KiB
YAML

version: 2
jobs:
# =======================================================================================
# Python 3.6 testing.
# =======================================================================================
test-3.6:
docker:
- image: python:3.6
working_directory: ~/spleeter
steps:
- checkout
- restore_cache:
key: models-{{ checksum "spleeter/model/__init__.py" }}
- 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 pytest-xdist
- run:
name: run tests
command: make test
- save_cache:
key: models-{{ checksum "spleeter/model/__init__.py" }}
paths:
- "pretrained_models"
# =======================================================================================
# Python 3.7 testing.
# =======================================================================================
test-3.7:
docker:
- image: python:3.7
working_directory: ~/spleeter
steps:
- checkout
- restore_cache:
key: models-{{ checksum "spleeter/model/__init__.py" }}
- 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 pytest-xdist
- run:
name: run tests
command: make test
- save_cache:
key: models-{{ checksum "spleeter/model/__init__.py" }}
paths:
- "pretrained_models"
# =======================================================================================
# Source distribution packaging.
# =======================================================================================
sdist:
docker:
- image: python:3
steps:
- checkout
- run:
name: package source distribution
command: make build
- 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
# TODO: Infer destination regarding of branch.
# - master => production PyPi
# - other => testing PyPi
command: make deploy
# =======================================================================================
# Conda distribution.
# =======================================================================================
conda-forge-deploy:
docker:
- image: python:3
steps:
- run:
name: install dependencies
command: apt-get update && apt-get install -y git openssl hub
- run:
name: checkout feedstock
command: make feedstock
# =======================================================================================
# Docker build.
# =======================================================================================
docker-conda-cpu:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:conda -f docker/cpu/conda.dockerfile .
docker-conda-cpu-2stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:2-stems-conda -f docker/cpu/conda-2stems.dockerfile .
docker-conda-cpu-4stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:4-stems-conda -f docker/cpu/conda-4stems.dockerfile .
docker-conda-cpu-5stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:5-stems-conda -f docker/cpu/conda-5stems.dockerfile .
docker-3.6-cpu:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.6 -f docker/cpu/python-3.6.dockerfile .
docker-3.6-cpu-2stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.6-2stems -f docker/cpu/python-3.6-2stems.dockerfile .
docker-3.6-cpu-4stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.6-4stems -f docker/cpu/python-3.6-4stems.dockerfile .
docker-3.6-cpu-5stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.6-5stems -f docker/cpu/python-3.6-5stems.dockerfile .
docker-3.7-cpu:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.7 -f docker/cpu/python-3.7.dockerfile .
docker-3.7-cpu-2stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.7-2stems -f docker/cpu/python-3.7-2stems.dockerfile .
docker-3.7-cpu-4stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.7-4stems -f docker/cpu/python-3.7-4stems.dockerfile .
docker-3.7-cpu-5stems:
docker:
- image: docker:17.05.0-ce-git
steps:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: build image
command: docker build -t spleeter:3.7-5stems -f docker/cpu/python-3.7-5stems.dockerfile .
workflows:
version: 2
spleeter-release-pipeline:
jobs:
- test-3.6
- test-3.7
- sdist:
requires:
- test-3.6
- test-3.7
- pypi-deploy:
filters:
branches:
only:
- master
requires:
- sdist
- conda-forge-deploy:
filters:
branches:
only:
- master
requires:
- pypi-deploy
- hold:
type: approval
requires:
- pypi-deploy
- conda-forge-deploy
filters:
branches:
only:
- master
- docker-conda-cpu:
requires:
- hold
filters:
branches:
only:
- master
- docker-conda-cpu-2stems:
requires:
- docker-conda-cpu
filters:
branches:
only:
- master
- docker-conda-cpu-4stems:
requires:
- docker-conda-cpu
filters:
branches:
only:
- master
- docker-conda-cpu-5stems:
requires:
- docker-conda-cpu
filters:
branches:
only:
- master
- docker-3.6-cpu:
requires:
- hold
filters:
branches:
only:
- master
- docker-3.6-cpu-2stems:
requires:
- docker-3.6-cpu
filters:
branches:
only:
- master
- docker-3.6-cpu-4stems:
requires:
- docker-3.6-cpu
filters:
branches:
only:
- master
- docker-3.6-cpu-5stems:
requires:
- docker-3.6-cpu
filters:
branches:
only:
- master
- docker-3.7-cpu:
requires:
- hold
filters:
branches:
only:
- master
- docker-3.7-cpu-2stems:
requires:
- docker-3.7-cpu
filters:
branches:
only:
- master
- docker-3.7-cpu-4stems:
requires:
- docker-3.7-cpu
filters:
branches:
only:
- master
- docker-3.7-cpu-5stems:
requires:
- docker-3.7-cpu
filters:
branches:
only:
- master