diff --git a/testing/geckodriver/.travis.yml b/testing/geckodriver/.travis.yml index 743789841e3d..7d0c623b60ed 100644 --- a/testing/geckodriver/.travis.yml +++ b/testing/geckodriver/.travis.yml @@ -1,4 +1,9 @@ language: generic +cache: + directories: + - $HOME/.cargo + - $TRAVIS_BUILD_DIR/target + - $HOME/docker/ matrix: include: @@ -38,18 +43,21 @@ matrix: - gcc-mingw-w64-x86-64 - binutils-mingw-w64-x86-64 - libbz2-dev + - os: linux + env: + - TARGET=i686-pc-windows-gnu + - NAME=win32 + - EXT=zip + - USE_DOCKER=1 + dist: trusty + services: + - docker - os: osx env: - TARGET=x86_64-apple-darwin - NAME=macos - EXT=tar.gz -install: - - export PATH="$PATH:$HOME/.cargo/bin" - - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=beta - - rustc -V - - cargo -V - script: - bash ci.sh diff --git a/testing/geckodriver/build.sh b/testing/geckodriver/build.sh new file mode 100644 index 000000000000..186363e2beb8 --- /dev/null +++ b/testing/geckodriver/build.sh @@ -0,0 +1,148 @@ +set -ex + +print_versions() { + rustc -V + cargo -V +} + +rustup_install() { + export PATH="$PATH:$HOME/.cargo/bin" + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=beta +} + +# Add provided target to current Rust toolchain if it is not already +# the default or installed. +rustup_target_add() { + if ! rustup target list | grep -E "$1 \((default|installed)\)" + then + rustup target add $1 + fi +} + +setup_docker() { + apt-get -qq -y install zip + cd /mnt/host +} + +# Configure rustc target for cross compilation. Provided with a build +# target, this will determine which linker to use for cross compilation. +cargo_config() { + local prefix + + case "$TARGET" in + aarch64-unknown-linux-gnu) + prefix=aarch64-linux-gnu + ;; + arm*-unknown-linux-gnueabihf) + prefix=arm-linux-gnueabihf + ;; + arm-unknown-linux-gnueabi) + prefix=arm-linux-gnueabi + ;; + mipsel-unknown-linux-musl) + prefix=mipsel-openwrt-linux + ;; + x86_64-pc-windows-gnu) + prefix=x86_64-w64-mingw32 + ;; + *) + return + ;; + esac + + mkdir -p ~/.cargo + cat >~/.cargo/config <>~/.cargo/config <