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

WIP: Port bash script naveen521kk to .travis.yml #1

Closed
71 changes: 51 additions & 20 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,26 +73,40 @@ 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
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://aka.ms/nugetclidl -o $TMP/nuget.exe; fi
stuaxo marked this conversation as resolved.
Show resolved Hide resolved
# TODO - future versions of cairo-windows will build with tee support so should not be tagged 'with-tee'
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then curl -sS -L https://github.com/preshing/cairo-windows/releases/download/with-tee/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_PACKAGE -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_PACKAGE.$PYTHON_VERSION/tools/:$TMP/nuget-$ARCH/$PYTHON_PACKAGE.$PYTHON_VERSION/tools/Scripts:$PATH; fi
- python -m pip install --upgrade wheel
- 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

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 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
stuaxo marked this conversation as resolved.
Show resolved Hide resolved
- 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


deploy:
if: TRAVIS_OS_NAME = windows
provider: releases
file_glob: true
api_key: $GITHUBOAUTHTOKEN
file: dist/*
file: dist/*.whl
skip_cleanup: true
draft: true
stuaxo marked this conversation as resolved.
Show resolved Hide resolved