Skip to content

Commit

Permalink
CI on Windows
Browse files Browse the repository at this point in the history
πŸŽ‰πŸ‘β˜½πŸ—”

Fix #821.
  • Loading branch information
liZe committed Mar 12, 2019
1 parent 167ebce commit b02602f
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: python
sudo: false
env: PYTHON=python

git:
submodules: false
Expand All @@ -14,16 +15,25 @@ matrix:
python: 3.7
- os: osx
language: generic
env: PYTHON_VERSION=3
env: PYTHON=python3
- os: windows
# Windows doesn't support python or even generic language
language: cpp
env: PYTHON=/c/Python37/python

addons:
apt:
packages:
- ttf-dejavu

before_install:
# As setup.py doesn't use pip, setuptools is not updated before installing dependencies
- python$PYTHON_VERSION -m pip install --upgrade setuptools
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export "PATH=$PATH;C:\msys64\mingw64\bin"; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y python dejavufonts; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz"; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z e msys2-base-x86_64-20180531.tar.xz; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z x -y msys2-base-x86_64-20180531.tar -oc:\\; fi
# We need powershell because Travis' bash and MSYS2's bash rely on conflicting libraries
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell "C:\msys64\usr\bin\bash -lc 'pacman -S mingw-w64-x86_64-gtk3 --noconfirm'"; fi

# Pango 1.38+ is needed to make @font-face work, remove these two lines when it's available on Travis
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p ~/.fonts; fi
Expand All @@ -36,5 +46,11 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install font-dejavu-sans; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cairo pango gdk-pixbuf libffi; fi

# As setup.py doesn't use pip, setuptools is not updated before installing dependencies
- $PYTHON -m pip install --upgrade pip setuptools

# Upgrade cffi to avoid errors while installing cairocffi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then $PYTHON -m pip install --upgrade cffi; fi

script:
- python$PYTHON_VERSION setup.py test
- $PYTHON setup.py test

0 comments on commit b02602f

Please sign in to comment.