From 19fb2207dd15242fe1a6dcb0451c00bec32d94fc Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 11:35:30 -0800 Subject: [PATCH 01/15] [#757] Move deploy to it's own stage on CI so it doesn't run multiple times --- .travis.yml | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 297ce340..b10cb9b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,25 @@ jobs: - pip install poetry~=0.12.17 env: - PATH=/c/Python37:/c/Python37/Scripts:$PATH + - stage: "Deploy" + before_deploy: + - poetry config http-basic.pypi $PYPI_USER $PYPI_PASS + - poetry version $TRAVIS_TAG + - poetry build + 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 + - git commit -m "Incrementing version to ${TRAVIS_TAG}" + - git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master allow_failures: - python: 3.8 - python: nightly @@ -47,21 +66,4 @@ install: - poetry run python --version script: - poetry run behave -before_deploy: - - poetry config http-basic.pypi $PYPI_USER $PYPI_PASS - - poetry version $TRAVIS_TAG - - poetry build -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 - - git commit -m "Incrementing version to ${TRAVIS_TAG}" - - git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master + From 44531bb47f7c53608809e6d12eb0726d4a649366 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 11:36:31 -0800 Subject: [PATCH 02/15] [#757] Take out old code (no longer needed) --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b10cb9b2..ad07de69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,8 +60,6 @@ before_install: - date - pip install poetry~=0.12.17 install: - # we run `poetry version` here to appease poetry about '0.0.0-source' - - poetry version - poetry install - poetry run python --version script: From 7fe1281c38e7b5706b8e9cc5768a6d23ca5c1d42 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 11:37:01 -0800 Subject: [PATCH 03/15] [#757] Add quotes around environment variables to be a little safer --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad07de69..a948fbac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ jobs: - PATH=/c/Python37:/c/Python37/Scripts:$PATH - stage: "Deploy" before_deploy: - - poetry config http-basic.pypi $PYPI_USER $PYPI_PASS - - poetry version $TRAVIS_TAG + - poetry config http-basic.pypi "$PYPI_USER" "$PYPI_PASS" + - poetry version "$TRAVIS_TAG" - poetry build deploy: - provider: script From f64f7428394c7be7994fd54bd21ac94015dde8fb Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 11:37:51 -0800 Subject: [PATCH 04/15] [#757] add stage name to test stage to be explicit --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a948fbac..ececef6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,8 @@ dist: xenial # required for Python >= 3.7 language: python jobs: include: - - name: "Python 3.6 on Linux" + - stage: "Test" + name: "Python 3.6 on Linux" python: 3.6 - name: "Python 3.7 on Linux" python: 3.7 From 7f83a1ef263816a8f5ca1a40499a674c198def43 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 11:38:14 -0800 Subject: [PATCH 05/15] [#757] add explicit os at root per travis config linter --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ececef6e..c65ac960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ dist: xenial # required for Python >= 3.7 +os: linux language: python jobs: include: From 427f1321b7bea1143f241b38dc68fdf3d2fda53b Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 12:11:17 -0800 Subject: [PATCH 06/15] [#757] update CI logic to new format --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c65ac960..2872d30c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ jobs: env: - PATH=/c/Python37:/c/Python37/Scripts:$PATH - stage: "Deploy" + if: branch = master AND tag IS present before_deploy: - poetry config http-basic.pypi "$PYPI_USER" "$PYPI_PASS" - poetry version "$TRAVIS_TAG" @@ -40,10 +41,6 @@ jobs: 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" From c6eab97f64e00bed82e0189f0c7049a68e3932cf Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 15:05:15 -0800 Subject: [PATCH 07/15] [#757] Take out unneeded quotes around strings in yaml --- .travis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2872d30c..501cbd5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,26 +3,26 @@ os: linux language: python jobs: include: - - stage: "Test" - name: "Python 3.6 on Linux" + - stage: Test + - name: Python 3.6 on Linux python: 3.6 - - name: "Python 3.7 on Linux" + - name: Python 3.7 on Linux python: 3.7 - - name: "Python 3.7 on Linux, not UTC" + - name: Python 3.7 on Linux, not UTC python: 3.7 env: - TZ=America/Edmonton - - name: "Python 3.8 on Linux" + - name: Python 3.8 on Linux python: 3.8 - - name: "Python dev on Linux" + - name: Python nightly on Linux python: nightly - - name: "Python 3.7.4 on MacOS" + - name: Python 3.7.4 on MacOS os: osx osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4 language: shell # 'language: python' is an error on Travis CI macOS before_install: - pip3 install poetry~=0.12.17 # 'pip' points to Python 2 on MacOS - - name: "Python 3.7.5 on Windows" + - name: Python 3.7 on Windows os: windows language: shell # 'language: python' is an error on Travis CI Windows before_install: @@ -32,7 +32,7 @@ jobs: - pip install poetry~=0.12.17 env: - PATH=/c/Python37:/c/Python37/Scripts:$PATH - - stage: "Deploy" + - stage: Deploy if: branch = master AND tag IS present before_deploy: - poetry config http-basic.pypi "$PYPI_USER" "$PYPI_PASS" From a01fb67c87e11f942adacff036be73d39ecca587 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 15:06:13 -0800 Subject: [PATCH 08/15] [#757] Clean up travis yaml file for readability --- .travis.yml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 501cbd5c..22b69409 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,28 @@ dist: xenial # required for Python >= 3.7 os: linux language: python +cache: pip + +git: + depth: false + +before_install: + - date + - pip install poetry~=0.12.17 + +install: + - poetry install + - poetry run python --version + +script: + - poetry run behave + jobs: + allow_failures: + - python: 3.8 + - python: nightly + - os: windows + include: - stage: Test - name: Python 3.6 on Linux @@ -32,6 +53,7 @@ jobs: - pip install poetry~=0.12.17 env: - PATH=/c/Python37:/c/Python37/Scripts:$PATH + - stage: Deploy if: branch = master AND tag IS present before_deploy: @@ -48,19 +70,4 @@ jobs: - git add pyproject.toml - git commit -m "Incrementing version to ${TRAVIS_TAG}" - git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git master - allow_failures: - - python: 3.8 - - python: nightly - - os: windows -git: - depth: false -cache: pip -before_install: - - date - - pip install poetry~=0.12.17 -install: - - poetry install - - poetry run python --version -script: - - poetry run behave From 7b27e6d0c08ab4f575329ded79cb2d2799a83509 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 15:07:44 -0800 Subject: [PATCH 09/15] [#757] Add more testing for Windows across multiple Python versions --- .travis.yml | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 22b69409..67b3cf2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,24 @@ git: before_install: - date - - pip install poetry~=0.12.17 install: + - pip install poetry~=0.12.17 - poetry install - poetry run python --version script: - poetry run behave +aliases: + test_windows: &test_windows + os: windows + language: shell + before_install: + - choco install python --version $JRNL_PYTHON_VERSION + - python -m pip install --upgrade pip + - pip --version + jobs: allow_failures: - python: 3.8 @@ -41,18 +50,21 @@ jobs: os: osx osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4 language: shell # 'language: python' is an error on Travis CI macOS - before_install: - - pip3 install poetry~=0.12.17 # 'pip' points to Python 2 on MacOS - - name: Python 3.7 on Windows - os: windows - language: shell # 'language: python' is an error on Travis CI Windows - before_install: - - choco install python --version 3.7.5 - - python -m pip install --upgrade pip - - pip --version - - pip install poetry~=0.12.17 + - <<: *test_windows + name: Python 3.6 on Windows env: + - JRNL_PYTHON_VERSION=3.6.8 + - PATH=/c/Python36:/c/Python36/Scripts:$PATH + - <<: *test_windows + name: Python 3.7 on Windows + env: + - JRNL_PYTHON_VERSION=3.7.5 - PATH=/c/Python37:/c/Python37/Scripts:$PATH + - <<: *test_windows + name: Python 3.8 on Windows + env: + - JRNL_PYTHON_VERSION=3.8.0 + - PATH=/c/Python38:/c/Python38/Scripts:$PATH - stage: Deploy if: branch = master AND tag IS present From cbd0014a52bd72cb4811fb05462049495fc68188 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 15:38:32 -0800 Subject: [PATCH 10/15] [#757] Add more Mac tests for each Python version --- .travis.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67b3cf2e..76214d83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,16 @@ script: - poetry run behave aliases: + test_mac: &test_mac + os: osx + language: shell + osx_image: xcode11.2 + 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 @@ -46,10 +56,20 @@ jobs: python: 3.8 - name: Python nightly on Linux python: nightly - - name: Python 3.7.4 on MacOS - os: osx - osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4 - language: shell # 'language: python' is an error on Travis CI macOS + + - <<: *test_mac + name: Python 3.6 on MacOS + env: + - JRNL_PYTHON_VERSION=3.6.8 + - <<: *test_mac + name: Python 3.7 on MacOS + env: + - JRNL_PYTHON_VERSION=3.7.4 + - <<: *test_mac + name: Python 3.8 on MacOS + env: + - JRNL_PYTHON_VERSION=3.8.0 + - <<: *test_windows name: Python 3.6 on Windows env: From f16e7860e043fff5b73036b1c16cf9e1b254e7ed Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 16:21:03 -0800 Subject: [PATCH 11/15] [#757] Group tests by python version --- .travis.yml | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 76214d83..c80e74f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,49 +43,55 @@ jobs: - os: windows include: - - stage: Test + # Python 3.6 Tests - name: Python 3.6 on Linux python: 3.6 - - name: Python 3.7 on Linux - python: 3.7 - - name: Python 3.7 on Linux, not UTC - python: 3.7 - env: - - TZ=America/Edmonton - - name: Python 3.8 on Linux - python: 3.8 - - name: Python nightly on Linux - python: nightly - - <<: *test_mac name: Python 3.6 on MacOS env: - JRNL_PYTHON_VERSION=3.6.8 - - <<: *test_mac - name: Python 3.7 on MacOS - env: - - JRNL_PYTHON_VERSION=3.7.4 - - <<: *test_mac - name: Python 3.8 on MacOS - env: - - JRNL_PYTHON_VERSION=3.8.0 - - <<: *test_windows name: Python 3.6 on Windows env: - JRNL_PYTHON_VERSION=3.6.8 - PATH=/c/Python36:/c/Python36/Scripts:$PATH + + # Python 3.7 Tests + - name: Python 3.7 on Linux + python: 3.7 + - <<: *test_mac + name: Python 3.7 on MacOS + env: + - JRNL_PYTHON_VERSION=3.7.4 - <<: *test_windows name: Python 3.7 on Windows env: - JRNL_PYTHON_VERSION=3.7.5 - PATH=/c/Python37:/c/Python37/Scripts:$PATH + + # Python 3.8 Tests + - name: Python 3.8 on Linux + python: 3.8 + - <<: *test_mac + name: Python 3.8 on MacOS + env: + - JRNL_PYTHON_VERSION=3.8.0 - <<: *test_windows name: Python 3.8 on Windows env: - JRNL_PYTHON_VERSION=3.8.0 - PATH=/c/Python38:/c/Python38/Scripts:$PATH + # ... and beyond! + - name: Python nightly on Linux + python: nightly + + # Specialty tests + - name: Python 3.7 on Linux, not UTC + python: 3.7 + env: + - TZ=America/Edmonton + - stage: Deploy if: branch = master AND tag IS present before_deploy: From 174632f8e38ba98b54ffc0c080b580d9976c094a Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 16:23:52 -0800 Subject: [PATCH 12/15] [#757] Be explicit about python versio so travis doesn't get confused --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index c80e74f2..9b010ffc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,10 +48,12 @@ jobs: 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: - JRNL_PYTHON_VERSION=3.6.8 - PATH=/c/Python36:/c/Python36/Scripts:$PATH @@ -61,10 +63,12 @@ jobs: python: 3.7 - <<: *test_mac name: Python 3.7 on MacOS + python: 3.7 env: - JRNL_PYTHON_VERSION=3.7.4 - <<: *test_windows name: Python 3.7 on Windows + python: 3.7 env: - JRNL_PYTHON_VERSION=3.7.5 - PATH=/c/Python37:/c/Python37/Scripts:$PATH @@ -74,10 +78,12 @@ jobs: 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: - JRNL_PYTHON_VERSION=3.8.0 - PATH=/c/Python38:/c/Python38/Scripts:$PATH From eb6c5200dedcc4a2fe9c1e6a5396b4bd4ff471a4 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 22:02:57 -0800 Subject: [PATCH 13/15] [#757] update caching for ci --- .travis.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b010ffc..7b4786fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ dist: xenial # required for Python >= 3.7 os: linux language: python -cache: pip + +cache: + - pip git: depth: false @@ -22,6 +24,9 @@ aliases: os: osx language: shell osx_image: xcode11.2 + cache: + directories: + - $HOME/.pyenv/versions before_install: - eval "$(pyenv init -)" - pyenv install -s $JRNL_PYTHON_VERSION @@ -31,6 +36,11 @@ aliases: 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 From e424e32a37f89cd72327a73bd4173a50a14450c4 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 22:03:40 -0800 Subject: [PATCH 14/15] [#757] Add fast finish option to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7b4786fb..949391bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,7 @@ aliases: - pip --version jobs: + fast_finish: true allow_failures: - python: 3.8 - python: nightly From a5b5f4732a0c967ed4a7ec5ef664a293700cd181 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Fri, 29 Nov 2019 22:04:02 -0800 Subject: [PATCH 15/15] [#757] update mac python version test to match others --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 949391bd..140349c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,7 +76,7 @@ jobs: name: Python 3.7 on MacOS python: 3.7 env: - - JRNL_PYTHON_VERSION=3.7.4 + - JRNL_PYTHON_VERSION=3.7.5 - <<: *test_windows name: Python 3.7 on Windows python: 3.7