| notifications: | |
| email: false | |
| language: cpp | |
| os: linux | |
| dist: bionic | |
| cache: | |
| ccache: true | |
| directories: | |
| - $HOME/.ccache | |
| jobs: | |
| include: | |
| - name: "Emscripten" | |
| env: CACHE_NAME=emscripten1 | |
| 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:1.39.10-fastcomp bash | |
| install: | |
| - docker exec -it emscripten apt update | |
| - docker exec -it emscripten apt -y install python3-setuptools | |
| - docker exec -it emscripten python3 -m pip install 32blit | |
| 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" | |
| dist: focal | |
| 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 | |
| python2 | |
| python3-pip | |
| python3-setuptools | |
| zip | |
| install: | |
| - python3 -m pip install 32blit bitstring construct | |
| after_success: | |
| - curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/adcc3a3e5bc16b360aa379d0fc23c3a6e1d9b21d/weigh_in.py | |
| - python2 weigh_in.py firmware/firmware.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: | |
| - ci/install_sdl_mingw.sh | |
| - name: "macOS" | |
| os: osx | |
| cache: | |
| directories: | |
| - $HOME/Library/Frameworks/SDL2.framework | |
| - $HOME/Library/Frameworks/SDL2_image.framework | |
| before_script: | |
| - ci/install_sdl_macos.sh | |
| - 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: | |
| - ci/install_sdl_vs.sh | |
| 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" | |
| - ci/install_sdl_vs.sh | |
| - 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 |