Improved CircleCI lint and cmake installation in mac

This commit is contained in:
Syrus 2019-01-18 11:33:25 -08:00
parent eb9f3fd274
commit e953308b0e

View File

@ -6,8 +6,27 @@ jobs:
- image: circleci/rust:latest - image: circleci/rust:latest
steps: steps:
- checkout - checkout
- run: rustup component add rustfmt - restore_cache:
- run: rustup component add clippy keys:
- lint-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
sudo apt-get install texinfo
sudo apt-get install libclang-dev llvm-3.9-dev libclang-3.9-dev clang-3.9
- run:
name: Install lint deps
command: |
rustup component add rustfmt
rustup component add clippy
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: lint-{{ arch }}-{{ checksum "Cargo.lock" }}
- run: - run:
name: Execute lints name: Execute lints
command: make lint command: make lint
@ -44,19 +63,19 @@ jobs:
keys: keys:
- v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }} - v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
- v4-cargo-cache-darwin-{{ arch }}-brew - v4-cargo-cache-darwin-{{ arch }}-brew
- run: # - run:
name: Install CMAKE # name: Install CMAKE
command: | # command: |
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz # curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
tar xf cmake-3.4.1-Darwin-x86_64.tar.gz # tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
- run: - run:
name: Upgrade Brew name: Upgrade Brew
command: brew upgrade || true command: brew upgrade || true
- run: - run:
name: Install libffi dependencies name: Install crate dependencies
command: | command: |
brew install autoconf automake libtool brew install autoconf automake libtool cmake
- save_cache: - save_cache:
paths: paths:
- /usr/local/Homebrew - /usr/local/Homebrew
@ -71,7 +90,7 @@ jobs:
- run: - run:
name: Execute tests name: Execute tests
command: | command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
# We increase the ulimit for fixing cargo unclosed files in mac # We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000 ulimit -n 8000
@ -80,7 +99,7 @@ jobs:
- run: - run:
name: Execute integration tests name: Execute integration tests
command: | command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
./integration_tests/nginx/test.sh ./integration_tests/nginx/test.sh
- save_cache: - save_cache:
@ -146,19 +165,19 @@ jobs:
keys: keys:
- v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }} - v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
- v4-cargo-cache-darwin-{{ arch }}-brew - v4-cargo-cache-darwin-{{ arch }}-brew
- run: # - run:
name: Install CMAKE # name: Install CMAKE
command: | # command: |
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz # curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
tar xf cmake-3.4.1-Darwin-x86_64.tar.gz # tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
- run: - run:
name: Upgrade Brew name: Upgrade Brew
command: brew upgrade || true command: brew upgrade || true
- run: - run:
name: Install libffi dependencies name: Install crate dependencies
command: | command: |
brew install autoconf automake libtool brew install autoconf automake libtool cmake
- save_cache: - save_cache:
paths: paths:
- /usr/local/Homebrew - /usr/local/Homebrew
@ -173,7 +192,7 @@ jobs:
- run: - run:
name: Execute tests name: Execute tests
command: | command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
# We increase the ulimit for fixing cargo unclosed files in mac # We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000 ulimit -n 8000
@ -182,7 +201,7 @@ jobs:
- run: - run:
name: Make release build name: Make release build
command: | command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH" # export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
make release make release
mkdir -p artifacts mkdir -p artifacts