From 904cd5ea148da2dde2d1001da046f9a4408f44e2 Mon Sep 17 00:00:00 2001 From: Eric Kidd Date: Wed, 8 Apr 2020 13:05:00 -0400 Subject: [PATCH] ci: Add Linux builds and update scripts This should get us OpenSSL & Vault support on the Mac. --- .travis.yml | 50 ++++++++++++++++++-------------------------------- Dockerfile | 5 ++--- build-release | 4 ++-- 3 files changed, 22 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e356d94..bbcc4f3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,32 @@ language: rust -dist: trusty sudo: required +os: +- linux +- osx +rust: +- stable services: - docker -matrix: - fast_finish: true - allow_failures: - - rust: nightly - include: - - os: linux - rust: stable - env: "FEATURE_OPTS=''" - - os: linux - rust: beta - env: "FEATURE_OPTS=''" - - os: linux - rust: nightly - env: "FEATURE_OPTS=''" - - os: osx - rust: stable - # Still no SSL on the Mac, because upgrading would need to deal with - # https://github.com/faradayio/boondock/issues/14 - env: "FEATURE_OPTS='--no-default-features'" +before_script: + - rustup component add rustfmt + - rustup component add clippy script: -- cargo test $FEATURE_OPTS -- cargo build $FEATURE_OPTS + # Require `cargo fmt` to have been run. + - cargo fmt -- --check + # Require clippy to pass without warnings. This also fails for regular Rust + # warnings. + - cargo clippy -- -D warnings + # Build the code. + - cargo build --verbose + # Run the tests. + - cargo test --verbose before_deploy: "./build-release cage ${TRAVIS_TAG}-${TRAVIS_OS_NAME}" deploy: provider: releases - api_key: - secure: JLDn2TGYLpu/sPB5jQ8pZk1yhsub3hPlvqoR+Z0WI9nxwHDWqPSP2nvO93tGkbjOSU4jOB79fg5m4mi1jKoBfSTb+xqFxwBig3WT++rjvHLkht5Gq7Vz63YglgwYGFL2ElCmdWXp3YKmZGNRpoXBs+mmA2/ZKOOmoJqYKqBdfm68y7iQi+jCAl9whv3/mmVloEP4xPEyCuenGyzxpCHxPHFgXZOHCV2djgFLcMmVM0ykBskYz4+EnOl3l9p+NctKB6PEshdkXmdgS/3FtbTTBouDzOGld6vKIdK3g5YA+7btzXTaAUxLS9Pn2R2uLnkicWu+U5Glf3Ur80pydBm8xLiqT0qM+7EYDmFKvF3vBPEofrW9ZFx2aDRWb5Lze7KrWx1I/3nXqczFF60FU+duKmQ+JoPE9htvEOsQmRHhA4TFpye5A7+/lw/bdI8nnllnuN000+tzM64dAYwzmS5rhhe8Iof+LxLGegfG8DyHzGFB8oXoVGBo3G4wP5TiO5rEJFp+YdZ3mHK4Kdfz4GSwzORB4CT2Z+2jTxzLvRkZ/1xyBd0mVYHAnzMDfCnZFAtV17XezZPSiul9EMlt7Xlnr+5zn8ff1/QA0+x1vyq4oPn4ZzyInLRESNYCY58YB6ThmuDp4YskHCfGF0Pthik5ogweQdJn8sODWdLcLALpMEM= + api_key: $GITHUB_TOKEN file_glob: true file: "cage-${TRAVIS_TAG}-${TRAVIS_OS_NAME}.*" skip_cleanup: true on: - repo: faradayio/cage rust: stable tags: true -notifications: - webhooks: - urls: - - "https://webhooks.gitter.im/e/717bec1dd1d6de43c44c" - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/Dockerfile b/Dockerfile index 622211e7..9512172b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM ekidd/rust-musl-builder # We need to add the source code to the image because `rust-musl-builder` # assumes a UID of 1000, but TravisCI has switched to 2000. -ADD . ./ -RUN sudo chown -R rust:rust . +ADD --chown=rust:rust . ./ -CMD cargo build --release +CMD cargo build --release \ No newline at end of file diff --git a/build-release b/build-release index ad118a60..9eef107a 100755 --- a/build-release +++ b/build-release @@ -28,7 +28,7 @@ case `uname -s` in ;; *) echo "Building standard release binaries" - cargo build --release --no-default-features + cargo build --release zip -j "$1"-"$2".zip target/release/"$1" ;; -esac +esac \ No newline at end of file