2018-11-05 17:03:09 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-11-17 18:43:05 +00:00
|
|
|
# Job used for testing
|
|
|
|
test:
|
|
|
|
docker:
|
|
|
|
- image: circleci/rust:latest
|
2019-01-18 18:10:16 +00:00
|
|
|
resource_class: medium+
|
2018-11-17 18:43:05 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v4-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
|
|
|
|
- run: sudo apt-get install -y cmake
|
2018-12-27 01:54:41 +00:00
|
|
|
- run: sudo apt-get install texinfo
|
2018-12-27 02:03:29 +00:00
|
|
|
- run: sudo apt-get install libclang-dev llvm-3.9-dev libclang-3.9-dev clang-3.9
|
2018-11-17 18:43:05 +00:00
|
|
|
- run: make test
|
2018-12-15 06:45:03 +00:00
|
|
|
- run: rustup component add rustfmt
|
2019-01-11 05:18:40 +00:00
|
|
|
- run: rustup component add clippy
|
2018-12-15 06:45:03 +00:00
|
|
|
- run: make lint
|
2018-11-17 18:43:05 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
- target/debug/.fingerprint
|
|
|
|
- target/debug/build
|
|
|
|
- target/debug/deps
|
|
|
|
key: v4-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
|
|
|
|
|
2019-01-01 20:12:48 +00:00
|
|
|
test-macos:
|
|
|
|
macos:
|
|
|
|
xcode: "9.0"
|
2019-01-18 18:10:16 +00:00
|
|
|
resource_class: medium+
|
2019-01-01 20:12:48 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2019-01-18 19:07:03 +00:00
|
|
|
- v4-cargo-cache-darwin-{{ arch }}-brew
|
2019-01-01 20:12:48 +00:00
|
|
|
- run:
|
|
|
|
name: Install CMAKE
|
|
|
|
command: |
|
|
|
|
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
|
|
|
|
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
|
2019-01-10 23:15:28 +00:00
|
|
|
- run:
|
|
|
|
name: Upgrade Brew
|
2019-01-18 18:59:47 +00:00
|
|
|
command: brew upgrade || true
|
2019-01-09 23:23:22 +00:00
|
|
|
- run:
|
|
|
|
name: Install libffi dependencies
|
|
|
|
command: |
|
|
|
|
brew install autoconf automake libtool
|
2019-01-18 19:07:03 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/Homebrew
|
|
|
|
- /usr/local/Cellar
|
|
|
|
key: v4-cargo-cache-darwin-{{ arch }}-brew
|
2019-01-01 20:12:48 +00:00
|
|
|
- run:
|
|
|
|
name: Install Rust
|
|
|
|
command: |
|
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
cargo --version
|
|
|
|
rustup component add rustfmt
|
2019-01-11 05:18:40 +00:00
|
|
|
rustup component add clippy
|
2019-01-01 20:12:48 +00:00
|
|
|
- run:
|
|
|
|
name: Execute tests
|
|
|
|
command: |
|
|
|
|
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
# We increase the ulimit for fixing cargo unclosed files in mac
|
|
|
|
ulimit -n 8000
|
|
|
|
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
|
|
|
|
make test
|
|
|
|
make lint
|
2019-01-14 04:56:59 +00:00
|
|
|
- run:
|
|
|
|
name: Execute integration tests
|
|
|
|
command: |
|
|
|
|
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
./integration_tests/nginx/test.sh
|
2019-01-18 18:59:47 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
- target/debug/.fingerprint
|
|
|
|
- target/debug/build
|
|
|
|
- target/debug/deps
|
|
|
|
- target/release/.fingerprint
|
|
|
|
- target/release/build
|
|
|
|
- target/release/deps
|
|
|
|
key: v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2019-01-01 20:12:48 +00:00
|
|
|
|
2018-11-17 18:43:05 +00:00
|
|
|
test-and-build:
|
2018-11-05 17:03:09 +00:00
|
|
|
docker:
|
2018-11-05 17:10:34 +00:00
|
|
|
- image: circleci/rust:latest
|
2019-01-18 18:10:16 +00:00
|
|
|
resource_class: medium+
|
2018-11-05 17:03:09 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2018-11-13 19:36:04 +00:00
|
|
|
- v4-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2018-11-05 17:12:59 +00:00
|
|
|
- run: sudo apt-get install -y cmake
|
2018-12-27 01:54:41 +00:00
|
|
|
- run: sudo apt-get install texinfo
|
2018-12-27 02:03:29 +00:00
|
|
|
- run: sudo apt-get install libclang-dev llvm-3.9-dev libclang-3.9-dev clang-3.9
|
2018-11-13 18:28:50 +00:00
|
|
|
- run:
|
2018-11-23 18:35:41 +00:00
|
|
|
name: Execute tests
|
|
|
|
command: make test
|
2018-12-15 06:45:03 +00:00
|
|
|
- run: rustup component add rustfmt
|
2019-01-11 05:18:40 +00:00
|
|
|
- run: rustup component add clippy
|
2018-12-15 06:45:03 +00:00
|
|
|
- run:
|
|
|
|
name: Execute lints
|
|
|
|
command: make lint
|
2018-11-23 18:35:41 +00:00
|
|
|
- run:
|
|
|
|
name: Make release build
|
2018-11-13 18:28:50 +00:00
|
|
|
command: |
|
|
|
|
make release
|
|
|
|
mkdir -p artifacts
|
2018-11-13 18:51:04 +00:00
|
|
|
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
2018-12-04 02:57:26 +00:00
|
|
|
# GIT_VERSION=$(git describe --exact-match --tags)
|
2018-11-13 18:51:04 +00:00
|
|
|
echo "${VERSION}" >> artifacts/version
|
2018-12-04 02:57:26 +00:00
|
|
|
echo "${CIRCLE_TAG}" >> artifacts/git_version
|
2018-11-13 18:28:50 +00:00
|
|
|
cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- artifacts
|
2018-11-05 17:03:09 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
- target/debug/.fingerprint
|
|
|
|
- target/debug/build
|
|
|
|
- target/debug/deps
|
2018-11-13 19:36:04 +00:00
|
|
|
- target/release/.fingerprint
|
2018-11-13 18:28:50 +00:00
|
|
|
- target/release/build
|
|
|
|
- target/release/deps
|
2019-01-18 18:59:47 +00:00
|
|
|
- /usr/local/Homebrew
|
2018-11-13 19:36:04 +00:00
|
|
|
key: v4-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2018-11-13 18:28:50 +00:00
|
|
|
|
2018-11-17 18:43:05 +00:00
|
|
|
test-and-build-macos:
|
2018-11-13 19:36:04 +00:00
|
|
|
macos:
|
|
|
|
xcode: "9.0"
|
2019-01-18 18:10:16 +00:00
|
|
|
resource_class: medium+
|
2018-11-13 19:36:04 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2019-01-18 19:07:03 +00:00
|
|
|
- v4-cargo-cache-darwin-{{ arch }}-brew
|
2018-11-13 19:36:04 +00:00
|
|
|
- run:
|
|
|
|
name: Install CMAKE
|
|
|
|
command: |
|
2018-11-13 19:48:34 +00:00
|
|
|
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
|
2018-11-13 19:36:04 +00:00
|
|
|
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"
|
2019-01-10 23:15:28 +00:00
|
|
|
- run:
|
|
|
|
name: Upgrade Brew
|
2019-01-18 18:59:47 +00:00
|
|
|
command: brew upgrade || true
|
2019-01-09 23:23:22 +00:00
|
|
|
- run:
|
|
|
|
name: Install libffi dependencies
|
|
|
|
command: |
|
|
|
|
brew install autoconf automake libtool
|
2019-01-18 19:07:03 +00:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/Homebrew
|
|
|
|
- /usr/local/Cellar
|
|
|
|
key: v4-cargo-cache-darwin-{{ arch }}-brew
|
2018-11-13 19:36:04 +00:00
|
|
|
- run:
|
2018-11-15 21:30:00 +00:00
|
|
|
name: Install Rust
|
2018-11-13 19:53:27 +00:00
|
|
|
command: |
|
2018-11-15 21:30:00 +00:00
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
2018-11-13 19:53:27 +00:00
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
cargo --version
|
2018-12-15 06:45:03 +00:00
|
|
|
rustup component add rustfmt
|
2019-01-11 05:18:40 +00:00
|
|
|
rustup component add clippy
|
2018-11-13 19:36:04 +00:00
|
|
|
- run:
|
2018-11-13 19:53:27 +00:00
|
|
|
name: Execute tests
|
2018-11-13 20:12:02 +00:00
|
|
|
command: |
|
2018-11-13 19:53:27 +00:00
|
|
|
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
2018-12-28 12:59:55 +00:00
|
|
|
# We increase the ulimit for fixing cargo unclosed files in mac
|
|
|
|
ulimit -n 8000
|
|
|
|
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
|
2018-11-13 19:53:27 +00:00
|
|
|
make test
|
2018-12-15 06:45:03 +00:00
|
|
|
make lint
|
2018-11-13 19:53:27 +00:00
|
|
|
- run:
|
2018-11-23 18:35:41 +00:00
|
|
|
name: Make release build
|
2018-11-13 19:36:04 +00:00
|
|
|
command: |
|
2018-11-13 19:53:27 +00:00
|
|
|
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
2018-11-13 19:36:04 +00:00
|
|
|
make release
|
|
|
|
mkdir -p artifacts
|
2018-11-13 20:12:02 +00:00
|
|
|
# VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
|
|
|
|
# echo "${VERSION}" >> artifacts/version
|
2018-11-13 19:36:04 +00:00
|
|
|
cp ./target/release/wasmer ./artifacts/$(./binary-name.sh)
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- artifacts
|
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
- target/debug/.fingerprint
|
|
|
|
- target/debug/build
|
|
|
|
- target/debug/deps
|
|
|
|
- target/release/.fingerprint
|
|
|
|
- target/release/build
|
|
|
|
- target/release/deps
|
|
|
|
key: v4-cargo-cache-darwin-{{ arch }}-{{ checksum "Cargo.lock" }}
|
2018-11-13 18:28:50 +00:00
|
|
|
|
2018-12-24 19:38:54 +00:00
|
|
|
test-rust-nightly:
|
|
|
|
docker:
|
|
|
|
- image: circleci/rust:latest
|
2019-01-18 18:10:16 +00:00
|
|
|
resource_class: medium+
|
2018-12-24 19:38:54 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2018-12-24 20:15:31 +00:00
|
|
|
- v4-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly
|
2018-12-24 19:38:54 +00:00
|
|
|
- run: sudo apt-get install -y cmake
|
2018-12-27 01:58:30 +00:00
|
|
|
- run: sudo apt-get install texinfo
|
2018-12-27 02:03:29 +00:00
|
|
|
- run: sudo apt-get install libclang-dev llvm-3.9-dev libclang-3.9-dev clang-3.9
|
2018-12-24 19:38:54 +00:00
|
|
|
- run: rustup default nightly
|
|
|
|
- run: make test
|
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
- target/debug/.fingerprint
|
|
|
|
- target/debug/build
|
|
|
|
- target/debug/deps
|
2018-12-24 20:15:31 +00:00
|
|
|
key: v4-test-cargo-cache-linux-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly
|
2018-12-24 19:38:54 +00:00
|
|
|
|
2018-11-13 18:28:50 +00:00
|
|
|
publish-github-release:
|
|
|
|
docker:
|
|
|
|
- image: cibuilds/github
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: "Publish Release on GitHub"
|
|
|
|
command: |
|
|
|
|
# go get github.com/tcnksm/ghr
|
|
|
|
# VERSION=$(git log -1 --pretty=%B)
|
2018-11-23 18:35:41 +00:00
|
|
|
# VERSION=$(./artifacts/ --version)
|
2018-11-13 18:51:04 +00:00
|
|
|
VERSION=$(cat ./artifacts/version)
|
2018-12-04 02:19:03 +00:00
|
|
|
# VERSION_TAG=${CIRCLE_TAG}
|
2018-12-04 02:53:48 +00:00
|
|
|
VERSION_TAG=$(cat ./artifacts/git_version)
|
2018-12-05 23:15:12 +00:00
|
|
|
rm ./artifacts/version
|
|
|
|
rm ./artifacts/git_version
|
2018-12-04 02:53:48 +00:00
|
|
|
# VERSION_TAG=$(git describe --exact-match --tags)
|
2018-12-04 03:04:25 +00:00
|
|
|
#if [ "$VERSION" == "$VERSION_TAG" ]; then
|
|
|
|
# echo "Versions match, publishing to Github"
|
2018-12-22 19:33:22 +00:00
|
|
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -soft ${VERSION} ./artifacts/
|
2018-12-04 03:04:25 +00:00
|
|
|
#else
|
|
|
|
# echo "Versions don't match. Wasmer output version (wasmer --version) is ${VERSION} while Git tag is ${VERSION_TAG}"
|
|
|
|
# exit 1
|
|
|
|
#fi
|
2018-11-13 18:28:50 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
main:
|
|
|
|
jobs:
|
2018-11-17 18:43:05 +00:00
|
|
|
- test:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
2019-01-01 20:12:48 +00:00
|
|
|
- test-macos:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
2018-11-17 18:43:05 +00:00
|
|
|
- test-and-build:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
|
|
|
- test-and-build-macos:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
2018-12-24 19:38:54 +00:00
|
|
|
- test-rust-nightly:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|
2018-11-13 18:28:50 +00:00
|
|
|
# :
|
|
|
|
# filters:
|
|
|
|
# tags:
|
|
|
|
# only: /^\d+\.\d+\.\d+$/
|
|
|
|
|
|
|
|
- publish-github-release:
|
|
|
|
requires:
|
2018-11-17 18:43:05 +00:00
|
|
|
- test-and-build
|
|
|
|
- test-and-build-macos
|
2018-11-23 18:35:41 +00:00
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^\d+\.\d+\.\d+$/
|