jrnl/.travis.yml
Jonathan Wren d3d3ef4c3e Update Poetry requirements for testing latest Python version (#898)
Poetry errors out if we try to run a different version of Python that
what is specified in the config file. We want to run tests against the
latest Python version so we can see problems before they happen. This
fix updates the config file so Poetry will allow us to test. Nothing is
committed after the update.
2020-04-10 16:18:34 -07:00

157 lines
3.8 KiB
YAML

dist: xenial # required for Python >= 3.7
os: linux
language: python
cache:
pip: true
directories:
- $HOME/virtualenv
git:
depth: false
autocrlf: false
before_install:
- date
install:
- pip install --upgrade poetry
- 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
- $HOME/Library/Caches/pypoetry
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
env: &env_windows
PATH: /c/Python36:/c/Python36/Scripts:/c/Python37:/c/Python37/Scripts:/c/Python38:/c/Python38/Scripts:$PATH
PYTHONIOENCODING: UTF-8
cache:
directories:
- /c/Python36
- /c/Python37
- /c/Python38
- /c/ProgramData/chocolatey/lib
- /c/ProgramData/chocolatey/bin
- /c/Users/travis/AppData/Local/pypoetry/Cache
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
include:
- name: Lint, via Black
python: 3.8
script:
- black --version
- black --check . --verbose --diff
# Python 3.6 Tests
- name: Python 3.6 on Linux
python: 3.6
- <<: *test_mac
name: Python 3.6 on MacOS
python: 3.6
env:
JRNL_PYTHON_VERSION: 3.6.8
- <<: *test_windows
name: Python 3.6 on Windows
python: 3.6
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.6.8
# Python 3.7 Tests
- name: Python 3.7 on Linux
python: 3.7
- <<: *test_mac
name: Python 3.7 on MacOS
python: 3.7
env:
JRNL_PYTHON_VERSION: 3.7.5
- <<: *test_windows
name: Python 3.7 on Windows
python: 3.7
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.7.5
# Python 3.8 Tests
- name: Python 3.8 on Linux
python: 3.8
- <<: *test_mac
name: Python 3.8 on MacOS
python: 3.8
env:
JRNL_PYTHON_VERSION: 3.8.0
- <<: *test_windows
name: Python 3.8 on Windows
python: 3.8
env:
<<: *env_windows
JRNL_PYTHON_VERSION: 3.8.0
# ... and beyond!
- name: Python nightly on Linux
before_install:
- sed -i 's/^python = ">=3\.6\.0.*"$/python = "*"/' pyproject.toml
python: nightly
# Specialty tests
- name: Python 3.7 on Linux, not UTC
python: 3.7
env:
TZ: America/Edmonton
# Changelog for Unreleased changes
- stage: Update Changelog
if: (tag IS present) OR (branch = develop AND type NOT IN (pull_request))
install:
- echo 'Skipping install'
script:
- ./.build/generate_changelog.sh
- stage: Deploy
if: tag IS present
before_deploy:
- poetry version "$TRAVIS_TAG"
- echo __version__ = \"$TRAVIS_TAG\" > jrnl/__version__.py
- poetry build
script:
- echo "Deployment starting..."
deploy:
- provider: script
script: poetry publish
skip_cleanup: true
on:
branch: master
tags: true
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 jrnl/__version__.py
- git commit -m "Incrementing version to ${TRAVIS_TAG} [ci skip]"
- git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master