jrnl/.travis.yml
Jonathan Wren 0c87ae52fb
testing
2020-01-14 18:59:52 -08:00

92 lines
2.2 KiB
YAML

dist: xenial # required for Python >= 3.7
os: linux
language: python
cache:
- pip
git:
depth: false
before_install:
- date
install:
- pip install poetry~=0.12.17
- poetry install
- poetry run python --version
script:
- poetry run behave
aliases:
test_mac: &test_mac
os: osx
language: shell
osx_image: xcode11.2
cache:
directories:
- $HOME/.pyenv/versions
before_install:
- eval "$(pyenv init -)"
- pyenv install -s $JRNL_PYTHON_VERSION
- pyenv global $JRNL_PYTHON_VERSION
- pip install --upgrade pip
- pip --version
test_windows: &test_windows
os: windows
language: shell
cache:
directories:
- /c/Python36
- /c/Python37
- /c/Python38
before_install:
- choco install python --version $JRNL_PYTHON_VERSION
- python -m pip install --upgrade pip
- pip --version
jobs:
fast_finish: true
allow_failures:
- python: nightly
- os: windows
include:
- name: Lint, via Black
python: 3.8
script:
- black --version
- black --check . --verbose --diff
# Changelog for Unreleased changes
- stage: Update Changelog
if: branch = develop AND type NOT IN (pull_request)
script:
- echo "Updating CHANGELOG.md (unreleased)"
- echo "For Reasons"
# Changelog for a tagged release
- stage: Update Changelog
if: branch = master AND tag IS present
script:
- echo "Updating CHANGELOG.md (release)"
- echo "For Reasons"
- stage: Deploy
if: branch = master AND tag IS present
before_deploy:
- poetry config pypi-token.pypi "$PYPI_TOKEN"
- poetry version "$TRAVIS_TAG"
- echo __version__ = \"$TRAVIS_TAG\" > jrnl/__version__.py
- poetry build
deploy:
- provider: script
script: poetry publish
after_deploy:
- git config --global user.email "jrnl.bot@gmail.com"
- git config --global user.name "Jrnl Bot"
- git checkout master
- git add pyproject.toml
- git commit -m "Incrementing version to ${TRAVIS_TAG} [ci skip]"
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master