Browse Source

Rework CI setup

Signed-off-by: falkTX <falktx@falktx.com>
pull/272/head
falkTX 4 years ago
parent
commit
ec35e8e452
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 57 additions and 30 deletions
  1. +19
    -12
      .travis.yml
  2. +13
    -5
      .travis/before_install.sh
  3. +25
    -13
      .travis/install.sh

+ 19
- 12
.travis.yml View File

@@ -1,18 +1,25 @@
os:
- linux
language: cpp

sudo: required
dist: trusty
cache:
directories:
- ${HOME}/debs

languages: c++
compiler: gcc
jobs:
include:
# linux native build
- name: "Linux native"
os: linux
compiler: gcc
dist: focal
env:
- TARGET="linux"

before_install:
- sh ${TRAVIS_BUILD_DIR}/.travis/before_install.sh
- bash ${TRAVIS_BUILD_DIR}/.travis/before_install.sh

install:
- sh ${TRAVIS_BUILD_DIR}/.travis/install.sh
- bash ${TRAVIS_BUILD_DIR}/.travis/install.sh

script:
- sh ${TRAVIS_BUILD_DIR}/.travis/script-linux.sh
- sh ${TRAVIS_BUILD_DIR}/.travis/script-macos.sh
- sh ${TRAVIS_BUILD_DIR}/.travis/script-win32.sh
- sh ${TRAVIS_BUILD_DIR}/.travis/script-win64.sh
- make
- make -C tests

+ 13
- 5
.travis/before_install.sh View File

@@ -2,9 +2,17 @@

set -e

sudo add-apt-repository ppa:kxstudio-debian/kxstudio -y
sudo add-apt-repository ppa:kxstudio-debian/mingw -y
sudo add-apt-repository ppa:kxstudio-debian/toolchain -y
sudo apt-get update -qq
sudo apt-get install kxstudio-repos
# Special macOS native handling
if [ "${TARGET}" = "macos" ] || [ "${TARGET}" = "macos-universal" ]; then
exit 0
fi

if [ "${TARGET}" = "win32" ] || [ "${TARGET}" = "win64" ]; then
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt-add-repository -y 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
sudo dpkg --add-architecture i386
fi

sudo apt-get update -qq
sudo apt-get install -y -o APT::Immediate-Configure=false libc6 libc6:i386 libgcc-s1:i386
sudo apt-get install -y -f

+ 25
- 13
.travis/install.sh View File

@@ -2,16 +2,28 @@

set -e

sudo apt-get install -y \
g++ \
pkg-config \
libcairo2-dev \
libjack-jackd2-dev \
liblo-dev \
libgl1-mesa-dev \
libx11-dev \
apple-x86-setup \
mingw32-x-gcc \
mingw32-x-pkgconfig \
mingw64-x-gcc \
mingw64-x-pkgconfig
# Special macOS native handling
if [ "${TARGET}" = "macos" ] || [ "${TARGET}" = "macos-universal" ]; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install cairo jack2 liblo
exit 0
fi

# Special handling for caching deb archives
if [ "$(ls ${HOME}/debs | wc -l)" -ne 0 ]; then
sudo cp ${HOME}/debs/*.deb /var/cache/apt/archives/
fi

# common
sudo apt-get install -y build-essential pkg-config

# specific
if [ "${TARGET}" = "win32" ]; then
sudo apt-get install -y binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 winehq-stable
elif [ "${TARGET}" = "win64" ]; then
sudo apt-get install -y binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 winehq-stable
else
sudo apt-get install -y libcairo2-dev libgl1-mesa-dev libjack-jackd2-dev liblo-dev libx11-dev
fi

# Special handling for caching deb archives
sudo mv /var/cache/apt/archives/*.deb ${HOME}/debs/

Loading…
Cancel
Save