buku/.circleci/config.yml

83 lines
1.9 KiB
YAML
Raw Normal View History

2019-04-03 08:42:56 -05:00
version: 2
test-template: &test-template
working_directory: ~/Buku
environment:
CI_FORCE_TEST: 1
steps:
- run:
command: |
apt update && apt install -y --no-install-recommends git
pip install --upgrade setuptools flake8 pylint
- checkout
- run:
command: |
pip install -e .[tests]
pip install -r requirements.txt
python3 -m flake8
echo buku | xargs pylint --rcfile tests/.pylintrc
find . -iname "*.py" ! -path "./api/*" | xargs pylint --rcfile tests/.pylintrc
python3 -m pytest ./tests/test_*.py --cov buku -vv --durations=0
jobs:
py35:
docker:
- image: python:3.5-slim
<<: *test-template
py36:
docker:
- image: python:3.6-slim
<<: *test-template
py37:
docker:
- image: python:3.7-slim
<<: *test-template
package-and-publish:
machine: true
working_directory: ~/Buku
steps:
- checkout
- run:
name: "package with packagecore"
command: |
# Use latest installed python3 from pyenv
export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' | tail -1)"
pip install packagecore
packagecore -o ./dist/ ${CIRCLE_TAG#v}
- run:
name: "publish to GitHub"
command: |
go get github.com/tcnksm/ghr
ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
workflows:
version: 2
test:
jobs: &all-tests
- py35
- py36
- py37
nightly:
triggers:
- schedule:
2019-04-13 02:30:43 -05:00
cron: "0 0 * * 6"
2019-04-03 08:42:56 -05:00
filters:
branches:
only:
- master
jobs: *all-tests
publish-github-release:
jobs:
- package-and-publish:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/