Skip to content

Commit

Permalink
WIP: Port bash script naveen521kk to .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
stuaxo committed Aug 20, 2020
1 parent 8883cf1 commit 895a850
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 64 deletions.
84 changes: 48 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@ matrix:
- os: windows
language: sh
python: 3.6
name: Build on Python 3.6.8 in Windows
env: PYVER="3.6.8" CAIRO_VERSION=1.17.2
name: Build on x64 Python 3.6.8 in Windows
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.6.8"
- os: windows
language: sh
python: 3.7
name: Build on Python 3.7.7 in Windows
env: PYVER="3.7.7" CAIRO_VERSION=1.17.2
name: Build on x64 Python 3.7.7 in Windows
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.7.7"
- os: windows
language: sh
python: 3.8
name: Build on Python 3.8.3 in Windows
env: PYVER="3.8.3" CAIRO_VERSION=1.17.2
name: Build on x64 Python 3.8.3 in Windows
env: ARCH=x64 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=python PYTHON_VERSION="3.8.3"
- os: windows
language: sh
python: 3.6
name: Build on x86 Python 3.6.8 in Windows
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.6.8"
- os: windows
language: sh
python: 3.7
name: Build on x86 Python 3.7.7 in Windows
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.7.7"
- os: windows
language: sh
python: 3.8
name: Build on x86 Python 3.8.3 in Windows
env: ARCH=x86 CAIRO_VERSION=1.17.2 PYTHON_PACKAGE=pythonx86 PYTHON_VERSION="3.8.3"
- os: linux
dist: trusty
language: python
Expand Down Expand Up @@ -44,6 +59,8 @@ matrix:
language: generic
name: Build on Python 3.8 in Mac OSX xcode11.3
env: CFLAGS="-Werror -coverage"


install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis_retry sudo apt-get update -q; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis_retry sudo apt-get install -y libcairo2-dev; fi
Expand All @@ -56,34 +73,29 @@ install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 -m pip install virtualenv; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then virtualenv ../venv -p python3; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then source ../venv/bin/activate; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade setuptools; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade pytest flake8 "sphinx<3" sphinx_rtd_theme coverage codecov hypothesis attrs; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m pip install --upgrade mypy || true; fi
script:
#windows build
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then source .travis/runPycairo.sh; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py sdist; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py bdist; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root=_root; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root="$(pwd)"/_root_abs; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py bdist_wheel; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python setup.py install --root=_root_setup; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then if [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]] ; then python -m pip install .; fi; fi
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then python -m sphinx -W -a -E -b html -n docs docs/_build; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://aka.ms/nugetclidl -o $TMP/nuget.exe; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://github.com/preshing/cairo-windows/releases/download/$CAIRO_VERSION/cairo-windows-$CAIRO_VERSION.zip -o $TMP/cairo-windows-$CAIRO_VERSION.zip; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then 7z x $TMP/cairo-windows-$CAIRO_VERSION.zip -o$TMP; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then $TMP/nuget install python -Version $PYTHON_VERSION -OutputDirectory $TMP/nuget-$ARCH; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export INCLUDE="$TMP/cairo-windows-$CAIRO_VERSION/include"; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export LIB=$TMP/cairo-windows-$CAIRO_VERSION/lib/$ARCH; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then export PATH=$TMP/nuget-$ARCH/python.$PYTHON_VERSION/tools/:PATH=$TMP/nuget-$ARCH/python.$PYTHON_VERSION/tools/Scripts:$PATH; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then python -m pip install --upgrade wheel; fi
- python -m pip install --upgrade setuptools
- python -m pip install --upgrade pytest flake8 "sphinx<3" sphinx_rtd_theme coverage codecov hypothesis attrs
- python -m pip install --upgrade mypy || true
- if [[ "$TRAVIS_OS_NAME" != "osx" ]] && [[ "$TRAVIS_PYTHON_VERSION" != "3.8" ]] && [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]]; then python -m pip install --upgrade pygame; fi

cache:
directories:
- $HOME/.cache/pip
- $HOME/Library/Caches/Homebrew

before_cache:
- brew cleanup
- rm -f $HOME/.cache/pip/log/debug.log

deploy:
provider: releases
file_glob: true
api_key: $GITHUBOAUTHTOKEN
file: dist/*
skip_cleanup: true
draft: true
script:
- if [[ "$TRAVIS_OS_NAME" == "windows" ]] ; then cp $TMP/cairo-windows-$CAIRO_VERSION/lib/$ARCH/cairo.dll cairo/cairo.dll; fi
- python -m coverage run --branch setup.py test
- python -m codecov --required || true
- python -m flake8 .
- python setup.py sdist
- python setup.py bdist
- python setup.py install --root=_root
- python setup.py install --root="$(pwd)"/_root_abs
- python setup.py bdist_wheel
- python setup.py install --root=_root_setup
- if [[ "${TRAVIS_PYTHON_VERSION:0:4}" != "pypy" ]] ; then python -m pip install .; fi
- python -m sphinx -W -a -E -b html -n docs docs/_build
28 changes: 0 additions & 28 deletions .travis/runPycairo.sh

This file was deleted.

0 comments on commit 895a850

Please sign in to comment.