Files
Iris/.circleci/config.yml

148 lines
3.5 KiB
YAML
Raw Normal View History

2019-11-24 21:17:41 +13:00
version: 2.1
orbs:
codecov: codecov/codecov@1.0.5
workflows:
version: 2
2020-02-08 09:57:20 +13:00
build_and_test:
2019-11-24 21:17:41 +13:00
jobs:
2020-02-08 09:57:20 +13:00
- py38:
filters:
branches:
only: deploy/test
- py37:
filters:
branches:
only: deploy/test
- black:
filters:
branches:
only: deploy/test
- check-manifest:
filters:
branches:
only: deploy/test
- flake8:
filters:
branches:
only: deploy/test
2020-02-08 09:55:06 +13:00
- build:
filters:
branches:
only: deploy/test
2020-02-08 09:57:20 +13:00
build_test_and_release:
2020-02-08 09:55:06 +13:00
jobs:
2020-02-08 09:57:20 +13:00
- py38:
filters:
branches:
only: deploy/release
- py37:
filters:
branches:
only: deploy/release
- black:
filters:
branches:
only: deploy/release
- check-manifest:
filters:
branches:
only: deploy/release
- flake8:
filters:
branches:
only: deploy/release
2020-02-08 09:55:06 +13:00
- build:
filters:
branches:
only: deploy/release
- deploy:
requires:
- build
filters:
branches:
only: deploy/release
2019-11-24 21:17:41 +13:00
2019-04-11 11:16:43 +12:00
jobs:
2019-11-24 21:17:41 +13:00
py38: &test-template
2019-04-11 11:16:43 +12:00
docker:
2019-11-24 21:17:41 +13:00
- image: mopidy/ci-python:3.8
2019-04-11 11:16:43 +12:00
steps:
- checkout
2019-04-11 11:43:36 +12:00
- restore_cache:
2019-11-24 21:17:41 +13:00
name: Restoring tox cache
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }}
2019-04-11 12:12:39 +12:00
- run:
2019-11-24 21:17:41 +13:00
name: Run tests
command: |
tox -e $CIRCLE_JOB -- \
--junit-xml=test-results/pytest/results.xml \
--cov-report=xml
2019-04-11 11:43:36 +12:00
- save_cache:
2019-11-24 21:17:41 +13:00
name: Saving tox cache
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }}
2019-04-11 11:43:36 +12:00
paths:
2019-11-24 21:17:41 +13:00
- ./.tox
- ~/.cache/pip
- codecov/upload:
file: coverage.xml
- store_test_results:
path: test-results
py37:
<<: *test-template
2019-04-11 11:16:43 +12:00
docker:
2019-11-24 21:17:41 +13:00
- image: mopidy/ci-python:3.7
black: *test-template
check-manifest: *test-template
flake8: *test-template
2020-02-08 09:55:06 +13:00
build:
docker:
- image: nikolaik/python-nodejs:python3.7-nodejs12-stretch
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:prod
- run:
name: Install python dependencies
command: pip install -e .
- save_cache:
paths:
- node_modules
- mopidy_iris
key: v1-dependencies-{{ checksum "VERSION.md" }}
deploy:
docker:
- image: nikolaik/python-nodejs:python3.7-nodejs12-stretch
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