blob: 50ce269a48fa42b1be87caacb199fccbdea21a4a [file] [edit]
notifications:
email: false
language: cpp
os: linux
dist: bionic
cache:
ccache: true
directories:
- $HOME/.ccache
jobs:
include:
- name: "Emscripten"
env: CACHE_NAME=emscripten
cache:
directories:
- $HOME/.emscripten_ports
- $HOME/.emscripten_cache
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src -v $HOME/.emscripten_ports:/emsdk_portable/.data/ports -v $HOME/.emscripten_cache:/emsdk_portable/.data/cache trzeci/emscripten:sdk-incoming-64bit bash
install:
script:
- docker exec -it emscripten emcmake cmake -B build.em -G "Unix Makefiles"
- docker exec -it emscripten make -C build.em
- name: "Linux"
env:
- RELEASE_FILE=${TRAVIS_BUILD_DIR}${REPO}-${TRAVIS_TAG}-${TRAVIS_BUILD_NUMBER}-LIN64
- CMAKE_ARGS="-DCMAKE_CXX_CLANG_TIDY=clang-tidy;-header-filter=32blit;-checks=performance-*,portability-*,modernize-*,-modernize-use-trailing-return-type,-modernize-avoid-c-arrays,-modernize-use-nodiscard"
addons:
apt:
clang-tidy
libsdl2-dev
libsdl2-image-dev
python3-pip
python3-setuptools
before_deploy:
- make install
- tar -zcf ${RELEASE_FILE}.tar.gz bin/
deploy:
provider: releases
file: ${RELEASE_FILE}.tar.gz
on:
tags: true
edge: true
- name: "STM32"
env:
- TOOLCHAIN=../32blit.toolchain
- RELEASE_FILE=${TRAVIS_BUILD_DIR}${REPO}-${TRAVIS_TAG}-${TRAVIS_BUILD_NUMBER}-STM32
addons:
apt:
gcc-arm-none-eabi
libnewlib-arm-none-eabi
libstdc++-arm-none-eabi-newlib
python3-pip
python3-setuptools
zip
install:
- python3 -m pip install bitstring construct
after_success:
- curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/adcc3a3e5bc16b360aa379d0fc23c3a6e1d9b21d/weigh_in.py
- python weigh_in.py firmware/flash-loader/flash-loader.bin
before_deploy:
- make install
- tar -zcf ${RELEASE_FILE}.tar.gz bin/
- zip -9 ${RELEASE_FILE}.zip bin/*
deploy:
provider: releases
file:
- ${RELEASE_FILE}.tar.gz
- ${RELEASE_FILE}.zip
on:
tags: true
edge: true
- name: "MinGW"
env:
- TOOLCHAIN=../mingw.toolchain
- CMAKE_ARGS="-DSDL2_DIR=$TRAVIS_BUILD_DIR/SDL2-2.0.10/x86_64-w64-mingw32/lib/cmake/SDL2/ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
cache:
directories:
- SDL2-2.0.10/
- $HOME/.ccache
addons:
apt:
g++-mingw-w64
python3-pip
python3-setuptools
zip
before_script:
- |
if [ ! -f SDL2_image-2.0.5/README.txt ]; then
curl https://libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz -o SDL2.tar.gz
curl https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-mingw.tar.gz -o SDL2_image.tar.gz
tar -xf SDL2.tar.gz
tar -xf SDL2_image.tar.gz
sed -i "s|/opt/local|$PWD/SDL2-2.0.10|g" ./SDL2-2.0.10/x86_64-w64-mingw32/lib/cmake/SDL2/sdl2-config.cmake
# copy SDL2_image into SDL2
cp -r ./SDL2_image-2.0.5/x86_64-w64-mingw32 ./SDL2-2.0.10/
fi
- name: "macOS"
os: osx
cache:
directories:
- $HOME/Library/Frameworks/SDL2.framework
- $HOME/Library/Frameworks/SDL2_image.framework
before_script:
- |
if [ ! -f ~/Library/Frameworks/SDL2_image.framework/SDL2_image ]; then
curl https://libsdl.org/release/SDL2-2.0.10.dmg -o SDL2.dmg
curl http://libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.dmg -o SDL2_image.dmg
hdiutil mount SDL2.dmg
hdiutil mount SDL2_image.dmg
mkdir -p ~/Library/Frameworks
cp -r /Volumes/SDL2/SDL2.framework ~/Library/Frameworks/
cp -r /Volumes/SDL2_image/SDL2_image.framework ~/Library/Frameworks/
fi
- name: "Visual Studio (CMake)"
os: windows
env:
- CMAKE_ARGS=-DSDL2_DIR=$TRAVIS_BUILD_DIR/vs/sdl
- RELEASE_FILE=${TRAVIS_BUILD_DIR}${REPO}-${TRAVIS_TAG}-${TRAVIS_BUILD_NUMBER}-WIN64
cache:
directories:
- vs/sdl/
before_install:
- choco uninstall -y mingw
- choco install -y python3 --version=3.8
- export PATH=$PATH:"c:\Python38"
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
before_script:
- |
if [ ! -f vs/sdl/include/SDL_image.h ]; then
curl https://libsdl.org/release/SDL2-devel-2.0.10-VC.zip -o SDL2.zip
curl https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip -o SDL2_image.zip
unzip SDL2.zip -d vs/sdl
unzip SDL2_image.zip -d vs/sdl
# move dirs up
mv vs/sdl/SDL2-2.0.10/* vs/sdl
cp -r vs/sdl/SDL2_image-2.0.5/* vs/sdl
fi
before_deploy:
- cmake --build . --target install
- 7z a ${RELEASE_FILE}.zip bin/*
deploy:
provider: releases
file: ${RELEASE_FILE}.zip
on:
tags: true
edge: true
- name: "Visual Studio (.sln)"
os: windows
cache:
directories:
- vs/sdl/
before_install:
- choco uninstall -y mingw
- choco install -y visualstudio2019buildtools visualstudio2019-workload-vctools python3
- export PATH=$PATH:"c:\Python38"
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
script:
- export PATH=$PATH:"c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
- |
if [ ! -f vs/sdl/include/SDL_image.h ]; then
curl https://libsdl.org/release/SDL2-devel-2.0.10-VC.zip -o SDL2.zip
curl https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip -o SDL2_image.zip
unzip SDL2.zip -d vs/sdl
unzip SDL2_image.zip -d vs/sdl
# move dirs up
mv vs/sdl/SDL2-2.0.10/* vs/sdl
cp -r vs/sdl/SDL2_image-2.0.5/* vs/sdl
fi
- msbuild.exe vs/32blit.sln
install:
- python3 -m pip install 32blit
script:
- ccache --zero-stats || true
- mkdir build && cd build
- cmake -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN -DCMAKE_INSTALL_PREFIX=`pwd` $CMAKE_ARGS ..
- cmake --build .
- ccache --show-stats || true