Skip to content

Commit

Permalink
add travis CI and appveyor CI configs
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMatula committed Jan 26, 2018
1 parent 9c0ba3a commit 6252797
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: '{build}'

environment:
WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.14.zip
matrix:
- CMAKE_GENERATOR: Visual Studio 14 2015 Win64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

matrix:
fast_finish: true

install:
- appveyor DownloadFile "https://downloads.sourceforge.net/project/winflexbison/%WINFLEXBISON_ARCHIVE%"
- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
- set Path=%CD%\winflexbison;%Path%

before_build:
- cmd: mkdir build
- cmd: cd build
- cmd: cmake -DCMAKE_CXX_FLAGS_RELEASE="/Od -DNDEBUG" -G"%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="install" -DRETDEC_TESTS=ON -DRETDEC_DEV_TOOLS=ON ..

build_script:
- cmd: cmake --build . --config Release -- /m
# Get wget, etc. needed for install step. If we do this earlier, build step fails.
# Otherwise, we could use `cmake --build . --config Release --target install -- -m` and save a few seconds.
- set Path=C:\msys64\usr\bin;C:\msys64\mingw64\bin;%Path%
- cmd: cmake --build . --config Release --target install

test_script:
# Test that install is movable and that it does not need build directory.
- cmd: mv install ../retdec-install
- cmd: cd ..
- cmd: rm -rf build
# Run unit tests.
- cmd: C:\msys64\usr\bin\bash.exe retdec-install\bin\retdec-tests-runner.sh
# Run decompilation script.
- cmd: C:\msys64\usr\bin\bash.exe retdec-install\bin\retdec-decompiler.sh --help
# Run simple decompilation.
- cmd: C:\msys64\usr\bin\echo.exe -e "#include <stdio.h>\n#include <stdlib.h>\nint main()\n{\n printf(\"hello world\\\n\");\n return 0;\n}\n" > hello-orig.c
- cmd: cat hello-orig.c
# Make sure 32-bit gcc will be used.
- set Path=C:\MinGW\bin;%Path%
- cmd: gcc.exe -o hello.exe hello-orig.c
# Prefer msys64 after we used 32-bit compiler.
- set Path=C:\msys64\usr\bin;C:\msys64\mingw64\bin;%Path%
- cmd: hello.exe
- cmd: C:\msys64\usr\bin\bash.exe retdec-install\bin\retdec-decompiler.sh hello.exe
- cmd: cat hello.c
- cmd: grep "int main(int argc, char \*\* argv)" hello.c

notifications:
- provider: Email
to:
- '{{commitAuthorEmail}}'
on_build_success: false
on_build_failure: true
on_build_status_changed: true
104 changes: 104 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
language: cpp

cache: ccache

matrix:
fast_finish: true
include:
- os: linux
dist: trusty
compiler: gcc-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- build-essential
- gcc-4.8-multilib
- gcc-4.9
- g++-4.9
- cmake
- perl
- python3
- flex
- bison
- autoconf
- automake
- libtool
- pkg-config
- m4
- coreutils
- zlib1g-dev
- libtinfo-dev
- wget
- bc
- upx
- openssl
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9 && NPROC=$(nproc)"
# We need this so that ccache does not cause compilation errors.
# e.g. retdec/tests/utils/string_tests.cpp:276:2: error: stray '\' in program
- CCACHE_CPP2=true

- os: osx
osx_image: xcode8.3
env:
- MATRIX_EVAL="NPROC=$(sysctl -n hw.physicalcpu)"
- CCACHE_CPP2=true

install:
# We need to install newer versions of Flex and Bison on MacOS X.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install flex bison; fi
# ccache is not installed on OS X.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install ccache; fi
# gnu-getopt
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install gnu-getopt; fi
# bash 4
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install bash; fi

before_script:
- eval "${MATRIX_EVAL}"
# We need to use newer versions of Flex and Bison on MacOS X (the ones from Homebrew).
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CMAKE_INCLUDE_PATH="/usr/local/opt/flex/include"; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CMAKE_LIBRARY_PATH="/usr/local/opt/flex/lib;/usr/local/opt/bison/lib"; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH"; fi
# Coreutils.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ln -s /usr/local/bin/greadlink /usr/local/bin/readlink; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"; fi
# We need to add ccache before everything else in PATH.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi

script:
- mkdir build && cd build
# We use "-O0" to speed-up build.
# "-O0" causes segfaults in LLVM if we do not use "-DNDEBUG" as well.
- cmake -DCMAKE_CXX_FLAGS_RELEASE="-O0 -DNDEBUG" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DRETDEC_TESTS=ON -DRETDEC_DEV_TOOLS=ON ..
- time make install -j $NPROC
# Test that install is movable and that it does not need build directory.
- mv install ../retdec-install
- cd ..
- rm -rf build
# Run unit tests.
- /usr/local/bin/bash retdec-install/bin/retdec-tests-runner.sh
# Run decompilation script.
- /usr/local/bin/bash retdec-install/bin/retdec-decompiler.sh --help
# Run simple decompilation.
- echo -e '#include <stdio.h>\n#include <stdlib.h>\nint main()\n{\n printf("hello world\\n");\n return 0;\n}\n' > hello-orig.c
- cat hello-orig.c
- gcc -m32 -o hello hello-orig.c
- ./hello
- /usr/local/bin/bash retdec-install/bin/retdec-decompiler.sh hello
- cat hello.c
- grep "int main(int argc, char \*\* argv)" hello.c

branches:
only:
# Pushes and PRs to the master branch.
- master
# Version tags.
- /^v?\d+\.\d+.*$/

notifications:
email:
on_success: never
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# RetDec

[![Travis CI build status](https://travis-ci.org/avast-tl/retdec.svg?branch=master)](https://travis-ci.org/avast-tl/retdec)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/avast-tl/retdec?branch=master&svg=true)](https://ci.appveyor.com/project/avast-tl/retdec)

[RetDec](https://retdec.com/) is a retargetable machine-code decompiler based on [LLVM](https://llvm.org/).

The decompiler is not limited to any particular target architecture, operating system, or executable file format:
Expand Down

0 comments on commit 6252797

Please sign in to comment.