version: 2 jobs: build: docker: - image: nikolaik/python-nodejs:python2.7-nodejs11 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "VERSION.md" }} - run: name: Install npm dependencies command: npm install - run: name: Build code command: npm run build - run: name: Install python dependencies command: pip install -e . - save_cache: paths: - node_modules - mopidy_iris key: v1-dependencies-{{ checksum "VERSION.md" }} test: docker: - image: nikolaik/python-nodejs:python2.7-nodejs11 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "VERSION.md" }} - run: name: Run tests command: npm run test deploy: docker: - image: nikolaik/python-nodejs:python2.7-nodejs11 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "VERSION.md" }} - run: name: Prepare .pypirc command: | echo -e "[distutils]" >> ~/.pypirc echo -e "index-servers =" >> ~/.pypirc echo -e " pypi" >> ~/.pypirc echo -e "[distutils]" >> ~/.pypirc echo -e "[pypi]" >> ~/.pypirc echo -e "username = jaedb" >> ~/.pypirc echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - run: name: Create and distribute package to pypi command: python setup.py sdist upload -r pypi workflows: version: 2 build_and_test: jobs: - build: filters: branches: only: develop - test: requires: - build filters: branches: only: develop build_test_and_deploy: jobs: - build: filters: branches: only: master - test: requires: - build filters: branches: only: master - deploy: requires: - build - test filters: branches: only: master