mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
187 lines
6.5 KiB
YAML
187 lines
6.5 KiB
YAML
name: Cutter CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-18.04] #, ubuntu-16.04, macos-latest, windows-latest]
|
|
python-version: [3.7.x]
|
|
system-deps: [false]
|
|
cc-override: [default]
|
|
cxx-override: [default]
|
|
include:
|
|
- os: ubuntu-16.04
|
|
python-version: 3.5.10
|
|
system-deps: true
|
|
cc-override: '/usr/bin/gcc-5'
|
|
cxx-override: '/usr/bin/g++-5'
|
|
# Prevent one job from pausing the rest
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.RIZIN_TOKEN }} # TODO: remove when the repo is public
|
|
submodules: recursive
|
|
persist-credentials: false
|
|
- name: apt dependencies
|
|
if: contains(matrix.os, 'ubuntu')
|
|
run: |
|
|
sudo apt-get install libgraphviz-dev mesa-common-dev
|
|
if [[ "${{ matrix.os }}" = "ubuntu-16.04" ]]
|
|
then
|
|
sudo apt-get install ninja-build/xenial-backports
|
|
if [[ "${{ matrix.system-deps }}" = "true" ]]
|
|
then
|
|
sudo apt-get install cmake
|
|
sudo apt-get install --allow-downgrades \
|
|
g++-5=5.4.\* \
|
|
gcc-5=5.4.\* \
|
|
gcc-5-base=5.4.\* \
|
|
libstdc++-5-dev=5.4.\* \
|
|
cpp-5=5.4.\* \
|
|
libgcc-5-dev=5.4.\* \
|
|
libasan2=5.4.\* \
|
|
libmpx0=5.4.\*
|
|
fi
|
|
# make sure cmake that was just installed is at the front of path before
|
|
# additional software installed by GitHub
|
|
echo /usr/bin >> $GITHUB_PATH
|
|
else
|
|
sudo apt-get install ninja-build
|
|
fi
|
|
if [[ "${{ matrix.system-deps }}" = "true" ]]
|
|
then
|
|
sudo apt-get install qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
|
|
fi
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: homebrew dependencies
|
|
if: contains(matrix.os, 'macos')
|
|
run: |
|
|
cd scripts
|
|
brew update --preinstall # temporary workaround for https://github.com/Homebrew/homebrew-bundle/issues/751
|
|
brew bundle
|
|
brew install coreutils
|
|
brew install pkg-config
|
|
- name: py dependencies
|
|
run: |
|
|
pip install meson
|
|
- name: cmake ubuntu
|
|
if: contains(matrix.os, 'ubuntu')
|
|
run: |
|
|
if [[ "${{ matrix.system-deps }}" = "false" ]]
|
|
then
|
|
scripts/fetch_deps.sh
|
|
source cutter-deps/env.sh
|
|
export PKG_CONFIG_PATH="$CUTTER_DEPS_PYTHON_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
|
|
export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH"
|
|
fi
|
|
set -euo pipefail #TODO: move to top once cutter-deps doesn't fail
|
|
if [[ "${{ matrix.cc-override }}" != "default" ]]
|
|
then
|
|
export CC="${{matrix.cc-override}}"
|
|
export CXX="${{matrix.cxx-override}}"
|
|
fi
|
|
|
|
source scripts/prepare_breakpad_linux.sh
|
|
export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}" #
|
|
mkdir build
|
|
cd build
|
|
cmake --version
|
|
if [[ "${{ matrix.system-deps }}" = "false" ]]
|
|
then
|
|
cmake \
|
|
-G Ninja \
|
|
-DCUTTER_ENABLE_PYTHON=ON \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DPYTHON_LIBRARY="$CUTTER_DEPS_PYTHON_PREFIX/lib/libpython3.6m.so.1.0" \
|
|
-DPYTHON_INCLUDE_DIR="$CUTTER_DEPS_PYTHON_PREFIX/include/python3.6m" \
|
|
-DPYTHON_EXECUTABLE="$CUTTER_DEPS_PYTHON_PREFIX/bin/python3" \
|
|
-DCUTTER_ENABLE_PYTHON_BINDINGS=OFF \
|
|
-DCUTTER_ENABLE_CRASH_REPORTS=ON \
|
|
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
|
../src && \
|
|
else
|
|
cmake \
|
|
-G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
|
../src
|
|
fi
|
|
ninja
|
|
- name: cmake macos
|
|
shell: bash
|
|
if: contains(matrix.os, 'macos')
|
|
run: |
|
|
scripts/fetch_deps.sh
|
|
source cutter-deps/env.sh
|
|
export PATH=/usr/local/opt/llvm/bin:$PATH
|
|
source scripts/prepare_breakpad_macos.sh
|
|
export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:$CUSTOM_PYTHON_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
mkdir build
|
|
cd build
|
|
cmake \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DPYTHON_LIBRARY="$CUTTER_DEPS_PYTHON_PREFIX/lib/libpython3.6m.dylib" \
|
|
-DPYTHON_INCLUDE_DIR="$CUTTER_DEPS_PYTHON_PREFIX/include/python3.6m" \
|
|
-DPYTHON_EXECUTABLE="$CUTTER_DEPS_PYTHON_PREFIX/bin/python3" \
|
|
-DCUTTER_ENABLE_PYTHON=ON \
|
|
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON \
|
|
-DCUTTER_ENABLE_CRASH_REPORTS=ON \
|
|
-DCUTTER_USE_BUNDLED_RIZIN=ON \
|
|
-DBREAKPAD_FRAMEWORK_DIR="$BREAKPAD_FRAMEWORK_DIR" \
|
|
../src && \
|
|
make -j4;
|
|
- name: windows dependencies
|
|
if: contains(matrix.os, 'windows-latest')
|
|
shell: bash
|
|
run: |
|
|
pip install ninja
|
|
scripts/fetch_deps.sh
|
|
choco install winflexbison3
|
|
- name: windows cmake
|
|
if: contains(matrix.os, 'windows-latest')
|
|
shell: cmd
|
|
run: |
|
|
set ARCH=x64
|
|
set CUTTER_DEPS=%CD%\cutter-deps
|
|
set PATH=%CD%\cutter-deps\qt\bin;%PATH%
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
|
|
call scripts\prepare_breakpad.bat
|
|
cd
|
|
mkdir build
|
|
cd build
|
|
set PACKAGE_NAME=cutter-git-x64.Windows
|
|
cmake ^
|
|
-DCMAKE_BUILD_TYPE=Release ^
|
|
-DCUTTER_USE_BUNDLED_RIZIN=ON ^
|
|
-DCUTTER_ENABLE_PYTHON=ON ^
|
|
-DCUTTER_ENABLE_PYTHON_BINDINGS=ON ^
|
|
-DCUTTER_PACKAGE_DEPENDENCIES=ON ^
|
|
-DCUTTER_PACKAGE_R2GHIDRA=ON ^
|
|
-DCUTTER_PACKAGE_R2DEC=ON ^
|
|
-DCUTTER_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
|
|
-DCUTTER_ENABLE_CRASH_REPORTS=ON ^
|
|
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
|
|
-DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^
|
|
-G Ninja ^
|
|
../src
|
|
cmake --build . --config Release
|
|
cmake --build . --config Release --target package
|
|
echo PACKAGE_NAME=%PACKAGE_NAME%.zip >> %GITHUB_ENV%
|
|
- uses: actions/upload-artifact@v2
|
|
if: env.PACKAGE_NAME != null
|
|
with:
|
|
name: ${{ env.PACKAGE_NAME }}
|
|
path: build/${{ env.PACKAGE_NAME }}
|