LIEF/.travis.yml

187 lines
8.4 KiB
YAML
Raw Normal View History

2017-03-30 16:56:49 +02:00
language: cpp
2020-04-26 14:45:17 +02:00
2018-02-15 09:29:38 +01:00
git:
depth: false
2017-03-30 16:56:49 +02:00
2020-04-26 14:45:17 +02:00
jobs:
2017-03-30 16:56:49 +02:00
include:
2020-04-26 14:45:17 +02:00
- os: linux
dist: xenial
services: docker
env: >
[
PYTHON_VERSION=3.5 ,
PYTHON_BINARY=/opt/python/cp35-cp35m/bin/python3.5 ,
]
- os: linux
dist: xenial
services: docker
env: >
[
PYTHON_VERSION=3.6 ,
PYTHON_BINARY=/opt/python/cp36-cp36m/bin/python3.6 ,
]
- os: linux
dist: xenial
services: docker
env: >
[
PYTHON_VERSION=3.7 ,
PYTHON_BINARY=/opt/python/cp37-cp37m/bin/python3.7 ,
]
- services: docker
env: >
[
PYTHON_VERSION=3.8 ,
PYTHON_BINARY=/opt/python/cp38-cp38/bin/python3.8 ,
]
# OSX 10.12 - xcode 8.3 - Python 3.5
2020-04-26 14:45:17 +02:00
- os: osx
osx_image: xcode8.3
compiler: clang
env: >
[
CXX=clang++ ,
CC=clang ,
PYTHON_VERSION=3.5 ,
]
# OSX 10.12 - xcode 8.3 - Python 3.6
- os: osx
osx_image: xcode8.3
compiler: clang
env: >
[
CXX=clang++ ,
CC=clang ,
PYTHON_VERSION=3.6 ,
]
# OSX 10.12 - xcode 10.1 - Python 3.7
- os: osx
osx_image: xcode10.1
compiler: clang
env: >
[
CXX=clang++ ,
CC=clang ,
PYTHON_VERSION=3.7 ,
]
# OSX 10.12 - xcode 10.1 - Python 3.8
- os: osx
osx_image: xcode10.1
compiler: clang
env: >
[
CXX=clang++ ,
CC=clang ,
PYTHON_VERSION=3.8 ,
]
2017-03-30 16:56:49 +02:00
#branches:
# only:
# - master
notifications:
email:
on_success: never
on_failure: always
2017-03-30 16:56:49 +02:00
cache:
- apt
- ccache
2017-07-25 17:06:30 +02:00
- $HOME/.pyenv
- build/rang_cpp_color-prefix
- build/mbed_tls
- build/libjson-prefix
- build/easyloggingpp-prefix
- build/tests/YAMLCPP
- build/tests/lief-samples
- build/tests/catch
- build/api/python/pybind11-prefix
2017-03-30 16:56:49 +02:00
before_install:
Build manylinux1-compliant wheels in Travis * Temporarily disable Melkor in test suite The Makefile uses the -executable flag which doesn't work on RHEL5. Disabling until I find a workaround for this. * Patch Makefile in Melkor fuzzer This replaces the `-executable` flag which is not supported by `find` on CentOS 5. * Respect CC environment variable Several tests hard coded /usr/bin/cc which might not exist in some environments. We first check the CC environment variable and fall back to the hard coded path if CC is unset. * Skip tests on GLIBC < 2.17 Some test binaries were linked against GLIBC 2.17. Skip tests which use this binary if the platform does not have the required GLIBC version. * Enable ccache in Docker in Travis builds * Run `auditwheel repair` on the produced wheels This will vendor the needed external shared libraries into the wheel and tag it as manylinux1. * Install ccache in Docker image * Avoid using bind mount volume in Docker build The bind mount volume wrote files as 'root' which causes issues with the deploy script in Travis. Copying the source code into the image and retrieving the built wheels instead of mounting the source tree fixes this issue. * Fix missing build folder when building with Docker After finishing the build inside Docker we need the build directory from the container to be able to deploy the built artifacts with deploy.sh. * Use the right Python interpreter for Linux builds The Dockerized .travis.yml builds attempt to invoke the interpreter in the PYTHON_BINARY environment variable, which is only valid inside the Docker image. To fix this, override the variable on Linux for tasks which require the host's Python interpreter. * Fix missing pip installation in Travis The Ubuntu image in Travis does not come with `pip` preinstalled for Python 3. * Remove .git directory from .dockerignore As `setup.py` uses `git` to determine the version number we need to copy the contents of `.git` into the image.
2019-08-22 22:05:53 +01:00
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then docker build -t lief/manylinux1_x86_64 .; fi
2017-03-30 16:56:49 +02:00
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PREFIX="/usr/local"; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
2017-03-30 16:56:49 +02:00
2017-04-06 11:17:53 +02:00
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs2"; fi
2017-03-30 16:56:49 +02:00
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv root; fi
2019-11-23 12:04:12 +01:00
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew upgrade pyenv||true; fi
2017-03-30 16:56:49 +02:00
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv install --list ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then pyenv install 2.7.12; fi
2020-04-26 16:56:07 +02:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then pyenv install --skip-existing 3.5.9; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then pyenv install --skip-existing 3.6.0; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.7" ]]; then pyenv install --skip-existing 3.7.0; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.8" ]]; then pyenv install --skip-existing 3.8.0; fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.7" ]]; then ls -alR $(pyenv root)/versions/3.7.0a1; fi
2017-03-30 16:56:49 +02:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/2.7.12/include/python2.7 ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/2.7.12/lib/libpython2.7.dylib ;fi
2017-04-06 09:46:36 +02:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/2.7.12/bin/python2.7 ;fi
2017-03-30 16:56:49 +02:00
2020-04-26 19:29:31 +02:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.5.9/include/python3.5m ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.5.9/lib/libpython3.dylib ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.5.9/bin/python3.5 ;fi
2017-03-30 16:56:49 +02:00
2017-12-10 15:57:20 +01:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.6.0/include/python3.6m ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.6.0/lib/libpython3.dylib ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.6.0/bin/python3.6 ;fi
2017-03-30 16:56:49 +02:00
2019-03-31 10:15:08 +02:00
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.7" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.7.0/include/python3.7m ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.7" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.7.0/lib/libpython3.7m.dylib ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.7" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.7.0/bin/python3.7 ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.8" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.8.0/include/python3. ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.8" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.8.0/bin/python3.8 ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then $PYTHON_BINARY -m pip install --upgrade pip ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then $PYTHON_BINARY -m pip install --upgrade setuptools ;fi
2017-03-30 16:56:49 +02:00
install:
- if [ "$GCOV" == "ON" ]; then sudo ln -sf /usr/bin/gcov-5 /usr/bin/gcov; fi
- if [ "$GCOV" == "ON" ]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz; fi
- if [ "$GCOV" == "ON" ]; then tar xf lcov_1.13.orig.tar.gz; fi
- if [ "$GCOV" == "ON" ]; then sudo make -C lcov-1.13/ install; fi
script:
Build manylinux1-compliant wheels in Travis * Temporarily disable Melkor in test suite The Makefile uses the -executable flag which doesn't work on RHEL5. Disabling until I find a workaround for this. * Patch Makefile in Melkor fuzzer This replaces the `-executable` flag which is not supported by `find` on CentOS 5. * Respect CC environment variable Several tests hard coded /usr/bin/cc which might not exist in some environments. We first check the CC environment variable and fall back to the hard coded path if CC is unset. * Skip tests on GLIBC < 2.17 Some test binaries were linked against GLIBC 2.17. Skip tests which use this binary if the platform does not have the required GLIBC version. * Enable ccache in Docker in Travis builds * Run `auditwheel repair` on the produced wheels This will vendor the needed external shared libraries into the wheel and tag it as manylinux1. * Install ccache in Docker image * Avoid using bind mount volume in Docker build The bind mount volume wrote files as 'root' which causes issues with the deploy script in Travis. Copying the source code into the image and retrieving the built wheels instead of mounting the source tree fixes this issue. * Fix missing build folder when building with Docker After finishing the build inside Docker we need the build directory from the container to be able to deploy the built artifacts with deploy.sh. * Use the right Python interpreter for Linux builds The Dockerized .travis.yml builds attempt to invoke the interpreter in the PYTHON_BINARY environment variable, which is only valid inside the Docker image. To fix this, override the variable on Linux for tasks which require the host's Python interpreter. * Fix missing pip installation in Travis The Ubuntu image in Travis does not come with `pip` preinstalled for Python 3. * Remove .git directory from .dockerignore As `setup.py` uses `git` to determine the version number we need to copy the contents of `.git` into the image.
2019-08-22 22:05:53 +01:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run --name lief_$PYTHON_VERSION -e PYTHON_BINARY=$PYTHON_BINARY -e CCACHE_DIR=/ccache -v $HOME/.ccache:/ccache lief/manylinux1_x86_64 bash -c '$PYTHON_BINARY setup.py --lief-test --sdk build -j8 bdist_wheel --dist-dir wheel_stage && auditwheel repair -w dist --plat manylinux1_x86_64 wheel_stage/*.whl ' && docker cp lief_$PYTHON_VERSION:/src/dist/ . && docker cp lief_$PYTHON_VERSION:/src/build/ .; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo $PYTHON_BINARY -m pip install -U pip setuptools wheel && $PYTHON_BINARY ./setup.py --lief-test --sdk build -j8 bdist_wheel; fi
2017-09-03 20:51:09 +02:00
2017-03-30 16:56:49 +02:00
after_success:
- make package
2019-11-23 12:04:12 +01:00
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PYTHON_BINARY=python3; sudo apt-get update && sudo apt-get install -y python3 python3-pip; fi
- sudo $PYTHON_BINARY -m pip install --upgrade pip
- sudo $PYTHON_BINARY -m pip install --upgrade setuptools
- sudo $PYTHON_BINARY -m pip install --upgrade requests mako wheel
2019-10-02 08:09:06 +02:00
#- if [[ -z "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --dev --formats=zip ;fi
#- if [[ -n "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --formats=zip ;fi
2017-07-13 08:55:57 +02:00
- cd $TRAVIS_BUILD_DIR
- bash ./.github/deploy.sh
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then $PYTHON_BINARY ./.github/trigger_docker.py ;fi
2017-03-30 16:56:49 +02:00
deploy:
provider: releases
2020-04-26 14:45:17 +02:00
token:
2019-11-24 08:52:32 +01:00
- secure: LTJMZp9kJ9/tmv73YGktP3Bdhh3moettDNooiRlQfUEgUemRlp9K+ybbufN0ya0Md0bouOJ/7nWqFToWl1G5/kcRr4MjV/P2c+iH8W7mvWcFupLGdwm1+aqpin3hiGsdYz0a1TK37y6DANspFwHILjq1SPf5L8kGEHnYSIfyUFHaETbv7GHL+4gf1XG/55KVuyFa3vZ2BPa3sIXr4bRypdNsqssFOZ7qeoJawtcI3TbjmLqx+sOGR2aiG+9lX+/vcYVGECHOE4KdV5BbTFitDLkJ0toAQrgN4XuB6XMXEnijU0RGtpkvsUAYJUuYaNcV2ea4bwLPCKz0IJvzTw3gtyB/pioP4OUx0xY2csuNuGfppZ0Fb+BWhPx9wOg209lrPjtoWszK8vo4PywKlEUviNG+3hEYx9x382IbtbXvIxp+c2iYdRicudFIdjjSZt7fy1MwBvHhWoBRl1hVw5fpFvRIC6Q1/B6MV55Jc3LVYCs+QHPAXq2KJ1KWK/Q7mmlriG3O+dvswcE1l0/AmeqKuXLsgUMuzScYa4fMFvXL3l/B8bKw205ynMzKvbb61P3sGrJJ+AFDEoHDk8yNtSaTowoUveu75DbL1s1p02QjYeVt7AJS8AsqUm7QPcUU5iXW1gSgt50jD/46/uvK7NZCFj2LzkiVzM5JIbiUANx8pKA=
2017-03-30 16:56:49 +02:00
file_glob: true
file:
2019-11-24 08:33:30 +01:00
- ${TRAVIS_BUILD_DIR}/dist/*.whl
2017-03-30 16:56:49 +02:00
- ${TRAVIS_BUILD_DIR}/build/*.tar.gz
on:
2019-11-24 09:54:14 +01:00
#branch: master
tags: true
2017-03-30 16:56:49 +02:00