From 133a98033e734dac99d8827db99acc75615aea0a Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Thu, 1 Sep 2016 09:57:40 -0700 Subject: [PATCH] Adding support for Appveyor cache - Speeds up builds considerably - Requires stripping out some contents of the gcc arm compiler --- appveyor.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ce7efc0..4e4e8b8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,20 @@ # appveyor file for kiibohd/controller # Used to test out the Cygwin builds +# System Build Architecture platform: - x64 + +# Dependency Cache +cache: + # Cache gcc arm compiler (it's pruned to be under 100 MB) + # Invalidate whenever this file is changed + - c:/gcc-arm-none-eabi.zip -> appveyor.yml + + +# Build Matrix + Environment Variables +# NOTE: Only building using 32-bit on a 64-bit system. 64-bit Cygwin should also work fine (no reason to test atm) environment: global: CYG_MIRROR: http://cygwin.uib.no @@ -11,6 +22,7 @@ environment: CYG_ARCH: x86 CYG_ROOT: C:/cygwin WIN_CMAKE: "/cygdrive/c/Program Files (x86)/CMake/bin" + ARM_COMPILER_URL: https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q2-update/+download/gcc-arm-none-eabi-5_4-2016q2-20160622-win32.zip matrix: # Input Club Keyboard Tests - SCRIPT_DIR: Keyboards @@ -34,20 +46,38 @@ environment: - SCRIPT_DIR: Bootloader/Builds SCRIPT: mk20dx256vlh7.bash + +# Commands run before cloning git repo init: - git config --global core.autocrlf input + +# Setup Build Instance install: - 'appveyor DownloadFile http://cygwin.com/setup-%CYG_ARCH%.exe -FileName setup.exe' - 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P git -P make -P python3 -P ctags -P tree -P p7zip' - '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"' - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\"/%SCRIPT_DIR% && export wincmake_path=\"%WIN_CMAKE%\" && which cmake"' - - 'appveyor DownloadFile https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q2-update/+download/gcc-arm-none-eabi-5_4-2016q2-20160622-win32.zip -FileName gcc-arm-none-eabi.zip' + - '%CYG_ROOT%/bin/bash -lc "ls -l /cygdrive/c"' + # Only download if cache is missing + - if not exist c:/gcc-arm-none-eabi.zip appveyor DownloadFile %ARM_COMPILER_URL% -FileName c:/gcc-arm-none-eabi.zip + # Always try to strip out the unnecessary binaries + # Necessary, so we can fit gcc-arm-none-eabi.zip into the dependency cache + # For ARM Cortex-M4 we only need armv7e-m (also supports Cortex-M7) + # https://en.wikipedia.org/wiki/ARM_architecture#Cores + - 7z d c:/gcc-arm-none-eabi.zip "armv6*" -r + - 7z d c:/gcc-arm-none-eabi.zip "armv7-m*" -r + - 7z d c:/gcc-arm-none-eabi.zip "armv7-ar*" -r + - 7z d c:/gcc-arm-none-eabi.zip "armv8*" -r + - 7z d c:/gcc-arm-none-eabi.zip "*.html" -r - dir - cmake --version + +# Build Commands build_script: - - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && 7z x -o/ gcc-arm-none-eabi.zip"' + - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && du -sh /cygdrive/c/gcc-arm-none-eabi.zip"' + - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && 7z x -o/ /cygdrive/c/gcc-arm-none-eabi.zip"' - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && pwd"' - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && tree"' - '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && cmake --version"'