Skip to content

Commit

Permalink
Upgrade to CircleCI v2 (#310)
Browse files Browse the repository at this point in the history
* Switching to circleci v2

* Only build for Linux for now

* Sudo is not required anymore

* Update before installing packages

* Cope with non interactive terminals

* Use ci's working_directory

* Fixed typo

* Disable QT5 for now

* Build for more platforms

* Fixed workflow definition

* sudo is not required anymore

* Update before installing

* Install wget when building for tomtom

* Revert to 14.04 base image

* Install unzip for build_tomtom_*

* Install wget for build_android_*

* Install wget for build_android_*

* Install cmake for win32 build

* Install gettext for the win32 build

* Install build-essential for tomtom builds

* Setup common requirements

*  Install packages to build tt environment

install packages need to build tt environment
correct navit path
remove arm-genmarshal which  disturbing a second build run

* Splitting the tomtom builds into more steps

* Splitting the tomtom builds into more steps

* Working on the tomtom minimal build

* Fixed some paths issues for tomtom_minimal

* Added missing exports for tomtom_minimal

* Added missing tomtom requirements

* Save the result of the tomtom_minimal build

* Fixing the tomtom plugin build for CI v2

* Fixed job name misconfiguration

* Use less relative paths

* Fixed espeakdsp.c path

* Adding tomtom assets

* Removed superfluous popd

* Fixed contrib path

* Adding tomtom assets

* Compile espeakdsp directly to the correct path

* Compile espeakdsp directly to the correct path

* Compile espeakdsp directly to the correct path

* Recursively copy contrib/tomtom assets

* Fixed tomtom specific icons path

* Preparing the android ARM build for CI v2

* Adapting build path

* Added missing packages for android builds

* Updating android x86 scripts for ci v2

* Android-25 will require jdk-8

* Install openjdk-8 for Ubuntu 14.04

* Ensures that add-apt is available for android builds

* Cope with non interactive terminals

* Ensures that openjdk-7 isn't installed

* Updated artifacts for ci v2 / android arm

* Fixed apk path for ci_v2

* Fixed leftovers path for ci_v2

* Fixed artifacts path for android arm

* Fixed typos

* Fixed toolchain misconfiguration

* Specify android's api/nkd api versions

* Fixed apk path for ci_v2

* Store android/x86 artifacts
  • Loading branch information
pgrandin committed Sep 5, 2017
1 parent 4c89acc commit 063e2c7
Show file tree
Hide file tree
Showing 20 changed files with 376 additions and 716 deletions.
107 changes: 107 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,107 @@
version: 2
defaults: &defaults
docker:
- image: ubuntu:14.04

jobs:
build_linux:
<<: *defaults
steps:
- checkout
- run:
name: Build for Linux
command: |
bash ci/setup_common_requirements.sh
bash ci/build_linux.sh
build_android_arm:
<<: *defaults
steps:
- checkout
- run:
name: Setup common requirements
command: |
bash ci/setup_common_requirements.sh
- run:
name: Prepare the Android build environment
command: |
bash ci/setup_android.sh
- run:
name: Build for Android ARM
command: |
bash ci/build_android.sh
- store_artifacts:
path: android-arm/navit
build_android_x86:
<<: *defaults
steps:
- checkout
- run:
name: Setup common requirements
command: |
bash ci/setup_common_requirements.sh
- run:
name: Prepare the Android build environment
command: |
bash ci/setup_android.sh
- run:
name: Build for Android X86
command: |
bash ci/build_android_x86.sh
- store_artifacts:
path: android-x86/navit
build_win32:
<<: *defaults
steps:
- checkout
- run:
name: Build for Windows
command: |
bash ci/setup_common_requirements.sh
bash ci/build_win32.sh
build_tomtom_minimal:
<<: *defaults
steps:
- checkout
- run:
name: Setup common requirements
command: |
bash ci/setup_common_requirements.sh
- run:
name: Build the Tomtom toolchain
command: |
bash ci/setup_tomtom_requirements.sh
- run:
name: Build for Tomtom (minimal)
command: |
bash ci/build_tomtom_minimal.sh
- store_artifacts:
path: /tmp/tomtom/sdcard
build_tomtom_plugin:
<<: *defaults
steps:
- checkout
- run:
name: Setup common requirements
command: |
bash ci/setup_common_requirements.sh
- run:
name: Build the Tomtom toolchain
command: |
bash ci/setup_tomtom_requirements.sh
- run:
name: Build for Tomtom (plugin)
command: |
bash ci/build_tomtom_plugin.sh
- store_artifacts:
path: /tmp/tomtom/sdcard

workflows:
version: 2
build_all:
jobs:
- build_linux
- build_android_arm
- build_android_x86
- build_win32
- build_tomtom_minimal
- build_tomtom_plugin
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -704,9 +704,9 @@ if(ANDROID)
set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
list(APPEND NAVIT_LIBS log)
set(HAVE_API_ANDROID 1)
set_with_reason(graphics/android "Android detected" TRUE)
set_with_reason(speech/android "Android detected" TRUE)
set_with_reason(vehicle/android "Android detected" TRUE)
set_with_reason(graphics/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
set_with_reason(speech/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
set_with_reason(vehicle/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
set(SHARED_LIBNAVIT TRUE)

add_feature(XPM2PNG "Android detected" TRUE)
Expand Down
6 changes: 3 additions & 3 deletions Toolchain/arm-eabi.cmake
@@ -1,8 +1,8 @@
set(CMAKE_SYSTEM_NAME GNU)

set(ANDROID TRUE)
set(ANDROID_API_VERSION 9 CACHE STRING "Andriod API Version")
set(ANDROID_NDK_API_VERSION ${ANDROID_API_VERSION} CACHE STRING "Andriod NDK API Version")
set(ANDROID_API_VERSION 9 CACHE STRING "Android API Version")
set(ANDROID_NDK_API_VERSION ${ANDROID_API_VERSION} CACHE STRING "Android NDK API Version")
set(ANDROID_ARCH "armeabi" CACHE STRING "Android architecture")

find_program(CMAKE_C_COMPILER NAMES arm-eabi-gcc arm-eabi-gcc.exe arm-linux-androideabi-gcc arm-linux-androideabi-gcc.exe)
Expand All @@ -11,7 +11,7 @@ set(PKG_CONFIG_EXECUTABLE "arm-eabi-pkg-config")

get_filename_component(COMPILER_PATH ${CMAKE_C_COMPILER} PATH)

set(ANDROID_NDK "${COMPILER_PATH}/../../../../.." CACHE STRING "PATH to Andriod NDK")
set(ANDROID_NDK "${COMPILER_PATH}/../../../../.." CACHE STRING "PATH to Android NDK")

set(NDK_ARCH_DIR "${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-arm")
set(CMAKE_FIND_ROOT_PATH ${NDK_ARCH_DIR})
Expand Down
6 changes: 3 additions & 3 deletions Toolchain/i686-android.cmake
@@ -1,8 +1,8 @@
set(CMAKE_SYSTEM_NAME GNU)

set(ANDROID TRUE)
set(ANDROID_API_VERSION 9 CACHE STRING "Andriod API Version")
set(ANDROID_NDK_API_VERSION ${ANDROID_API_VERSION} CACHE STRING "Andriod NDK API Version")
set(ANDROID_API_VERSION 9 CACHE STRING "Android API Version")
set(ANDROID_NDK_API_VERSION ${ANDROID_API_VERSION} CACHE STRING "Android NDK API Version")
set(ANDROID_ARCH "x86" CACHE STRING "Android architecture")

find_program(CMAKE_C_COMPILER NAMES i686-linux-android-gcc i686-linux-android-gcc.exe)
Expand All @@ -11,7 +11,7 @@ set(PKG_CONFIG_EXECUTABLE "i686-android-pkg-config")

get_filename_component(COMPILER_PATH ${CMAKE_C_COMPILER} PATH)

set(ANDROID_NDK "${COMPILER_PATH}/../../../../.." CACHE STRING "PATH to Andriod NDK")
set(ANDROID_NDK "${COMPILER_PATH}/../../../../.." CACHE STRING "PATH to Android NDK")

set(NDK_ARCH_DIR "${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-x86")
set(CMAKE_FIND_ROOT_PATH ${NDK_ARCH_DIR})
Expand Down
22 changes: 13 additions & 9 deletions ci/build_android.sh
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

apt-get update && apt-get install -y wget

export ARCH="arm"
export START_PATH=~/
export SOURCE_PATH=$START_PATH"/"${CIRCLE_PROJECT_REPONAME}"/"
Expand All @@ -10,28 +12,30 @@ export ANDROID_NDK_BIN=$ANDROID_NDK"/toolchains/arm-linux-androideabi-4.9/prebui
export ANDROID_SDK="/usr/local/android-sdk-linux/"
export ANDROID_SDK_PLATFORM_TOOLS=$ANDROID_SDK"/platform-tools"
export PATH=$ANDROID_NDK_BIN:$ANDROID_SDK_PLATFORM_TOOLS:$PATH
export BUILD_PATH=$START_PATH"/android-${ARCH}"
export BUILD_PATH=android-${ARCH}

export ANDROID_SDK_HOME=/opt/android-sdk-linux
export ANDROID_HOME=/opt/android-sdk-linux
export PATH=${PATH}:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/platform-tools:/opt/tools

wget -nv -c http://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
[ -d ~/android-ndk-r11c ] || unzip -q -d ~ android-ndk-r11c-linux-x86_64.zip

[ -d $BUILD_PATH ] || mkdir -p $BUILD_PATH
cd $BUILD_PATH
pushd $BUILD_PATH

android list targets

cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DCACHE_SIZE='(20*1024*1024)' -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=25 -DANDROID_NDK_API_VERSION=19 $SOURCE_PATH
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain/arm-eabi.cmake -DCACHE_SIZE='(20*1024*1024)' -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=25 -DANDROID_NDK_API_VERSION=19 ../

make -j $(nproc --all)

if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
make -j $(nproc --all) apkg-release && mv $BUILD_PATH/navit/android/bin/Navit-release-unsigned.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk || exit 1
make -j $(nproc --all) apkg-release && mv navit/android/bin/Navit-release-unsigned.apk navit/android/bin/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk || exit 1
else
make -j $(nproc --all) apkg && mv $BUILD_PATH/navit/android/bin/Navit-debug.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-debug.apk || exit 1
make -j $(nproc --all) apkg && mv navit/android/bin/Navit-debug.apk navit/android/bin/navit-$CIRCLE_SHA1-${ARCH}-debug.apk || exit 1
fi

[ -d $CIRCLE_ARTIFACTS/android-${ARCH}/ ] || mkdir $CIRCLE_ARTIFACTS/android-${ARCH}/
cp $BUILD_PATH/navit/*.xml $CIRCLE_ARTIFACTS/android-${ARCH}/

echo
echo "Build leftovers :"
ls $BUILD_PATH
find .
22 changes: 13 additions & 9 deletions ci/build_android_x86.sh
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

apt-get update && apt-get install -y wget

export ARCH="x86"
export START_PATH=~/
export SOURCE_PATH=$START_PATH"/"${CIRCLE_PROJECT_REPONAME}"/"
Expand All @@ -10,28 +12,30 @@ export ANDROID_NDK_BIN=$ANDROID_NDK"/toolchains/x86-4.9/prebuilt/linux-x86_64/bi
export ANDROID_SDK="/usr/local/android-sdk-linux/"
export ANDROID_SDK_PLATFORM_TOOLS=$ANDROID_SDK"/platform-tools"
export PATH=$ANDROID_NDK_BIN:$ANDROID_SDK_PLATFORM_TOOLS:$PATH
export BUILD_PATH=$START_PATH"/android-${ARCH}"
export BUILD_PATH=android-${ARCH}

export ANDROID_SDK_HOME=/opt/android-sdk-linux
export ANDROID_HOME=/opt/android-sdk-linux
export PATH=${PATH}:${ANDROID_SDK_HOME}/tools:${ANDROID_SDK_HOME}/platform-tools:/opt/tools


wget -nv -c http://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
[ -d ~/android-ndk-r11c ] || unzip -q -d ~ android-ndk-r11c-linux-x86_64.zip

[ -d $BUILD_PATH ] || mkdir -p $BUILD_PATH
cd $BUILD_PATH
pushd $BUILD_PATH

android list targets

cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_FILE -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=25 -DANDROID_NDK_API_VERSION=19 -DDISABLE_CXX=1 -DDISABLE_QT=1 $SOURCE_PATH
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain/i686-android.cmake -DAVOID_FLOAT=1 -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n -DANDROID_API_VERSION=25 -DANDROID_NDK_API_VERSION=19 -DDISABLE_CXX=1 -DDISABLE_QT=1 ..
make -j $(nproc --all)

if [[ "${CIRCLE_BRANCH}" == "master" ]]; then
make -j $(nproc --all) apkg-release && mv $BUILD_PATH/navit/android/bin/Navit-release-unsigned.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk || exit 1
make -j $(nproc --all) apkg-release && mv navit/android/bin/Navit-release-unsigned.apk navit/android/bin/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk || exit 1
else
make -j $(nproc --all) apkg && mv $BUILD_PATH/navit/android/bin/Navit-debug.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-debug.apk || exit 1
make -j $(nproc --all) apkg && mv navit/android/bin/Navit-debug.apk navit/android/bin/navit-$CIRCLE_SHA1-${ARCH}-debug.apk || exit 1
fi

[ -d $CIRCLE_ARTIFACTS/android-${ARCH}/ ] || mkdir $CIRCLE_ARTIFACTS/android-${ARCH}/
cp $BUILD_PATH/navit/*.xml $CIRCLE_ARTIFACTS/android-${ARCH}/

echo
echo "Build leftovers :"
ls $BUILD_PATH
find .
12 changes: 5 additions & 7 deletions ci/build_linux.sh
@@ -1,4 +1,6 @@
sudo apt-get install cmake libpng12-dev librsvg2-bin libfreetype6-dev libdbus-glib-1-dev g++ libgtk2.0-dev libqt5svg5-dev qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtmultimedia5-dev
set -e

apt-get install -y libpng12-dev librsvg2-bin libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev

cmake_opts="-Dgraphics/qt_qpainter:BOOL=FALSE -Dgui/qml:BOOL=FALSE -DSVG2PNG:BOOL=FALSE -DSAMPLE_MAP=n -Dgraphics/gtk_drawing_area:BOOL=TRUE"

Expand Down Expand Up @@ -26,15 +28,11 @@ if [[ "${CIRCLE_PROJECT_USERNAME}" == "navit-gps" && "${CIRCLE_BRANCH}" == "trun
curl "https://translations.launchpad.net/navit/${CIRCLE_BRANCH}/+translations-upload" -H "$lp_cookie" -H "Referer: https://translations.launchpad.net/navit/${CIRCLE_BRANCH}/+translations-upload" -F file=@po/navit.pot | grep title

else
mkdir ~/linux-bin && cd ~/linux-bin
cmake ~/${CIRCLE_PROJECT_REPONAME}/ ${cmake_opts} || exit -1
mkdir ${CIRCLE_WORKING_DIRECTORY}/linux-bin && cd ${CIRCLE_WORKING_DIRECTORY}/linux-bin
cmake ${CIRCLE_WORKING_DIRECTORY}/ ${cmake_opts} || exit -1
make -j $(nproc --all) || exit -1
fi

if [[ "$CIRCLE_ARTIFACTS" != "" ]]; then
cp -r navit/icons $CIRCLE_ARTIFACTS
fi


# Done with the builds tests. Running some app tests
bash ~/navit/ci/run_linux_tests.sh

0 comments on commit 063e2c7

Please sign in to comment.