Commit d884fd66 authored by David Michael Barr's avatar David Michael Barr Committed by GitHub

Use sccache in CI scripts (#1110)

* Extract archives in parallel with download
* Fetch sccache binary release
* Use sccache for C and C++ dependencies
* Limit sccache size to 500M
* Use CI generic cache to store compiler cache
parent 8dc2001c
......@@ -13,27 +13,37 @@ before_install:
- hash -r
- which cmake
- cmake --version
- wget https://download.videolan.org/contrib/nasm/nasm-2.14.tar.gz
- tar -xvf nasm-2.14.tar.gz
- curl -L https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-unknown-linux-musl.tar.gz | tar xvz
- export PATH=$PATH:`pwd`/sccache-0.2.8-x86_64-unknown-linux-musl
- export RUSTC_WRAPPER=sccache
- export SCCACHE_CACHE_SIZE=500M
- export SCCACHE_DIR=~/.cache/sccache
- curl -L https://download.videolan.org/contrib/nasm/nasm-2.14.tar.gz | tar xvz
- cd nasm-2.14
- ./configure && make -j2 && sudo make install
- ./configure CC='sccache gcc' && make -j2 && sudo make install
- nasm --version
- cd ..
- wget -O kcov.tar.gz https://github.com/SimonKagstrom/kcov/archive/v36.tar.gz
- tar -xvf kcov.tar.gz
- curl -L https://github.com/SimonKagstrom/kcov/archive/v36.tar.gz | tar xvz
- cd kcov-36
- mkdir .build && cd .build
- cmake -GNinja .. && ninja && sudo ninja install
- cmake -GNinja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .. && ninja && sudo ninja install
- cd ../..
- git clone --depth 1 -b v1.0.0-errata1 https://aomedia.googlesource.com/aom
- cd aom
- rm -rf CMakeCache.txt CMakeFiles
- mkdir -p .build
- cd .build
- cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DCONFIG_LOWBITDEPTH=1 -DCMAKE_INSTALL_PREFIX=/usr -DCONFIG_PIC=1
- cmake -GNinja .. -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DCONFIG_LOWBITDEPTH=1 -DCMAKE_INSTALL_PREFIX=/usr -DCONFIG_PIC=1
- ninja && sudo ninja install
- cd ../..
cache:
directories:
- "$HOME/.cache/sccache"
after_script:
- sccache -s
jobs:
include:
- name: "Build & Coveralls"
......
......@@ -17,20 +17,29 @@ install:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- appveyor DownloadFile https://people.xiph.org/~tdaede/nasm-2.14.02-win64.zip -FileName nasm.zip
- appveyor DownloadFile https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-pc-windows-msvc.tar.gz
- tar xzf sccache-0.2.8-x86_64-pc-windows-msvc.tar.gz
- 7z e -y nasm.zip
- rustup-init -yv --default-toolchain %channel% --default-host %host%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin;%APPVEYOR_BUILD_FOLDER%;nasm-2.14.02
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin;%APPVEYOR_BUILD_FOLDER%;nasm-2.14.02;sccache-0.2.8-x86_64-pc-windows-msvc
- set RUSTC_WRAPPER=sccache
- set SCCACHE_CACHE_SIZE=500M
- set SCCACHE_DIR=%LOCALAPPDATA%\Mozilla\sccache
- ps: $Env:PKG_CONFIG_ALLOW_CROSS=1
- rustc -vV
- cargo -vV
- rustup target add %target%
on_success:
- sccache -s
cache:
- '%LOCALAPPDATA%\Mozilla\sccache'
build_script:
- git submodule update --init
- cargo build --release --target=%target%
test_script:
- git submodule update --init
- cargo test --target=%target% --verbose
artifacts:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment