Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for Windows #1158

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
62 changes: 59 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ x-pyenv-env: &x-pyenv-env >
PATH="${PYENV_ROOT}/shims:${PATH}"

x-pyenv-install: &x-pyenv-install |
# Ensure we have the targeted Python for tox to find on $PATH
PYENV="${PYENV_ROOT}/bin/pyenv"
# Ensure we have the targeted Python for tox to find on $PATH.
# Relative symlinks don't work on Git Bash, which is why
chrisjbremner marked this conversation as resolved.
Show resolved Hide resolved
# "${PYENV_ROOT}/bin/pyenv" isn't used.
PYENV="${PYENV_ROOT}/libexec/pyenv"
if [ ! -x "${PYENV}" ]; then
rm -rf ${PYENV_ROOT}
git clone https://github.com/pyenv/pyenv "${PYENV_ROOT}";
Expand All @@ -51,6 +53,9 @@ x-pyenv-install: &x-pyenv-install |
"${PYENV}" install --keep --skip-existing ${PYENV_VERSION}
"${PYENV}" global ${PYENV_VERSION}

x-pyenv-27-env: &x-pyenv-27-env >
PYENV_VERSION=2.7.18

x-pyenv-39-env: &x-pyenv-39-env >
PYENV_VERSION=3.9.1

Expand Down Expand Up @@ -89,7 +94,7 @@ x-osx-27-shard: &x-osx-27-shard
env:
- *x-tox-env
- *x-pyenv-env
- PYENV_VERSION=2.7.18
- *x-pyenv-27-env

x-osx-39-shard: &x-osx-39-shard
<<: *x-osx-shard
Expand All @@ -98,6 +103,41 @@ x-osx-39-shard: &x-osx-39-shard
- *x-pyenv-env
- *x-pyenv-39-env

x-windows-shard: &x-windows-shard
os: windows
language: shell
cache:
# The default is 3 minutes (180).
timeout: 300
directories:
- .pyenv_test
- "${PYENV_ROOT}"
install:
- *x-tox-install
- *x-pyenv-install

x-windows-27-shard: &x-windows-27-shard
<<: *x-windows-shard
before_install:
- choco install python2
chrisjbremner marked this conversation as resolved.
Show resolved Hide resolved
- python -m pip install --upgrade pip
env:
- PATH=/c/Python27:/c/Python27/Scripts:$PATH
- *x-tox-env
- *x-pyenv-env
- *x-pyenv-27-env

x-windows-39-shard: &x-windows-39-shard
<<: *x-windows-shard
before_install:
- choco install python --version 3.9.0
- python -m pip install --upgrade pip
env:
- PATH=/c/Python39:/c/Python39/Scripts:$PATH
- *x-tox-env
- *x-pyenv-env
- *x-pyenv-39-env

# NB: Travis partitions caches using a combination of os, language amd env vars. As such, we do not
# use TOXENV and instead pass the toxenv via -e on the command line. This helps ensure we share
# caches as much as possible (eg: all linux python 2.7.15 shards share a cache).
Expand Down Expand Up @@ -177,3 +217,19 @@ matrix:
- <<: *x-osx-39-shard
name: TOXENV=py39-integration
script: ${TOX_CMD} -e py39-integration

- <<: *x-windows-27-shard
name: TOXENV=py27
script: ${TOX_CMD} -e py27

- <<: *x-windows-39-shard
name: TOXENV=py39
script: ${TOX_CMD} -e py39

- <<: *x-windows-27-shard
name: TOXENV=py27-integration
script: ${TOX_CMD} -e py27-integration

- <<: *x-windows-39-shard
name: TOXENV=py39-integration
script: ${TOX_CMD} -e py39-integration