2019-06-25 11:28:07 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
executors:
|
|
|
|
linux:
|
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:10
|
|
|
|
|
2019-06-25 11:43:40 +00:00
|
|
|
commands:
|
|
|
|
build_and_test:
|
2018-03-28 13:20:39 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-03-11 21:33:43 +00:00
|
|
|
- run:
|
|
|
|
name: "Environment"
|
|
|
|
command: |
|
|
|
|
CC=${CC:-cc}
|
|
|
|
CXX=${CXX:-cpp}
|
|
|
|
echo CC: $CC
|
|
|
|
echo CXX: $CXX
|
|
|
|
$CC --version
|
|
|
|
$CXX --version
|
|
|
|
cmake --version
|
2018-03-28 13:20:39 +00:00
|
|
|
- run:
|
|
|
|
name: "Configure"
|
|
|
|
working_directory: ~/build
|
2019-03-14 17:02:41 +00:00
|
|
|
command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DEVMC_TESTING=ON $CMAKE_OPTIONS
|
2018-03-28 13:20:39 +00:00
|
|
|
- run:
|
|
|
|
name: "Build"
|
|
|
|
command: cmake --build ~/build
|
2018-04-11 10:55:01 +00:00
|
|
|
- run:
|
|
|
|
name: "Test"
|
2019-07-23 12:00:33 +00:00
|
|
|
command: |
|
|
|
|
cmake --build ~/build --target test -- ARGS="-j4 --schedule-random --output-on-failure"
|
2019-08-08 10:44:30 +00:00
|
|
|
# Test statically linked end-to-end example
|
2019-08-08 10:42:43 +00:00
|
|
|
~/build/examples/evmc-example-static
|
2019-08-08 10:44:30 +00:00
|
|
|
# Test dynamically loaded end-to-end example
|
2019-08-08 10:51:41 +00:00
|
|
|
~/build/examples/evmc-example ~/build/examples/example_vm/libevmc-example-vm.so
|
2018-04-11 13:19:41 +00:00
|
|
|
- run:
|
|
|
|
name: "Install"
|
|
|
|
command: cmake --build ~/build --target install
|
2018-04-18 14:32:24 +00:00
|
|
|
- run:
|
|
|
|
name: "Package"
|
|
|
|
command: |
|
2019-08-08 11:24:41 +00:00
|
|
|
cmake --build ~/build --target package_source
|
2018-04-18 14:32:24 +00:00
|
|
|
cmake --build ~/build --target package
|
|
|
|
mkdir ~/package
|
|
|
|
mv ~/build/evmc-*.tar.gz ~/package
|
|
|
|
- store_artifacts:
|
|
|
|
path: ~/package
|
|
|
|
destination: package
|
2019-04-23 19:47:21 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/build
|
|
|
|
paths:
|
|
|
|
- test/evmc-vmtester
|
2019-08-08 11:21:04 +00:00
|
|
|
- examples/evmc-example
|
2018-03-28 13:20:39 +00:00
|
|
|
|
2019-06-25 11:43:40 +00:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
lint:
|
2019-09-25 10:26:50 +00:00
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:12-lint
|
2019-06-25 11:43:40 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "Check code format"
|
|
|
|
command: |
|
|
|
|
clang-format --version
|
|
|
|
find examples include lib test -name '*.hpp' -o -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format -i
|
|
|
|
git diff --color --exit-code
|
|
|
|
- run:
|
|
|
|
name: "Run codespell"
|
|
|
|
command: |
|
2019-09-25 10:32:46 +00:00
|
|
|
codespell --quiet-level=4 --ignore-words=./.codespell-whitelist --skip=.git
|
2019-06-25 11:43:40 +00:00
|
|
|
- run:
|
|
|
|
name: "Check bumpversion"
|
|
|
|
command: |
|
|
|
|
export PATH="/home/builder/.local/bin:$PATH"
|
|
|
|
pip3 install bumpversion
|
|
|
|
bumpversion --dry-run --verbose major
|
|
|
|
bumpversion --dry-run --verbose minor
|
|
|
|
bumpversion --dry-run --verbose patch
|
2019-06-25 11:49:10 +00:00
|
|
|
- run:
|
|
|
|
name: "Test documentation"
|
|
|
|
command: |
|
|
|
|
cat Doxyfile | sed 's/HTML_OUTPUT = ./HTML_OUTPUT = ..\/docs/' | doxygen - > doxygen.log 2> doxygen.warnings
|
|
|
|
if [ -s doxygen.warnings ]; then
|
|
|
|
printf '\n\nDoxygen warnings:\n\n'
|
|
|
|
cat doxygen.warnings
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cat doxygen.log
|
|
|
|
- store_artifacts:
|
|
|
|
path: ~/docs
|
|
|
|
destination: docs
|
|
|
|
|
|
|
|
upload-docs:
|
|
|
|
executor: linux
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "Generate documentation"
|
|
|
|
command: doxygen Doxyfile
|
|
|
|
- run:
|
|
|
|
name: "Upload documentation"
|
|
|
|
command: |
|
|
|
|
git config user.email "docs-bot@ethereum.org"
|
|
|
|
git config user.name "Documentation Bot"
|
|
|
|
git add --all
|
|
|
|
git commit -m "Update docs"
|
|
|
|
git push -f "https://$GITHUB_TOKEN@github.com/ethereum/evmc.git" HEAD:gh-pages
|
2019-06-25 11:43:40 +00:00
|
|
|
|
2019-03-11 21:33:43 +00:00
|
|
|
build-cxx17:
|
2019-09-25 18:40:33 +00:00
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:12-gcc-8
|
2019-03-11 21:33:43 +00:00
|
|
|
environment:
|
|
|
|
CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic
|
2019-06-25 11:43:40 +00:00
|
|
|
steps:
|
|
|
|
- build_and_test
|
2019-03-11 21:33:43 +00:00
|
|
|
|
2019-04-29 13:21:07 +00:00
|
|
|
build-cxx14-asan:
|
2019-09-25 18:37:12 +00:00
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:12-clang-9
|
2018-08-28 09:06:53 +00:00
|
|
|
environment:
|
2019-04-29 13:21:07 +00:00
|
|
|
CMAKE_OPTIONS: -DTOOLCHAIN=cxx14-pic -DSANITIZE=address
|
2019-06-25 11:43:40 +00:00
|
|
|
steps:
|
|
|
|
- build_and_test
|
2019-01-15 13:00:25 +00:00
|
|
|
|
2019-03-11 21:33:43 +00:00
|
|
|
build-gcc6:
|
2019-09-25 12:52:39 +00:00
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:12-gcc-6
|
2019-06-25 11:43:40 +00:00
|
|
|
steps:
|
|
|
|
- build_and_test
|
2019-03-11 21:33:43 +00:00
|
|
|
|
2019-06-25 11:28:07 +00:00
|
|
|
build-clang38:
|
2019-09-25 12:52:45 +00:00
|
|
|
docker:
|
|
|
|
- image: ethereum/cpp-build-env:12-clang-3.8
|
2019-06-25 11:43:40 +00:00
|
|
|
steps:
|
|
|
|
- build_and_test
|
2018-08-28 09:06:53 +00:00
|
|
|
|
2019-06-25 09:25:53 +00:00
|
|
|
build-32bit:
|
|
|
|
executor: linux
|
|
|
|
environment:
|
|
|
|
CMAKE_OPTIONS: -DTOOLCHAIN=cxx11-32bit
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: "Install GCC 32-bit"
|
|
|
|
command: sudo apt -q update && sudo apt -qy install g++-multilib
|
|
|
|
- build_and_test
|
|
|
|
|
2019-03-13 21:29:58 +00:00
|
|
|
bindings-go-latest:
|
2018-08-20 10:15:09 +00:00
|
|
|
docker:
|
2019-03-13 21:29:58 +00:00
|
|
|
- image: circleci/golang
|
2018-08-20 10:15:09 +00:00
|
|
|
steps: &bindings-go-steps
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: "Go Build"
|
|
|
|
command: |
|
|
|
|
go get -v github.com/ethereum/go-ethereum/common
|
|
|
|
go build -v ./bindings/go/evmc
|
|
|
|
go vet -v ./bindings/go/evmc
|
2019-03-12 12:53:07 +00:00
|
|
|
go generate -v ./bindings/go/evmc
|
|
|
|
go test -v ./bindings/go/evmc
|
2018-08-20 10:15:09 +00:00
|
|
|
|
2019-03-13 21:29:58 +00:00
|
|
|
bindings-go-min:
|
2018-08-20 10:15:09 +00:00
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.9
|
|
|
|
steps: *bindings-go-steps
|
|
|
|
|
2019-03-13 13:37:59 +00:00
|
|
|
bindings-rust:
|
|
|
|
docker:
|
|
|
|
- image: rust:1
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Update environment
|
|
|
|
command: |
|
|
|
|
apt update
|
|
|
|
apt -y install libclang-dev clang
|
|
|
|
rustup component add rustfmt
|
|
|
|
rustup update
|
|
|
|
- run:
|
|
|
|
name: Check formatting
|
|
|
|
command: |
|
|
|
|
rustfmt --version
|
|
|
|
cargo fmt --all -- --check
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: cargo build
|
|
|
|
- run:
|
|
|
|
name: Test
|
|
|
|
command: cargo test
|
2019-04-23 19:47:21 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: ~/build
|
|
|
|
- run:
|
|
|
|
name: Test with evmc-vmtester
|
|
|
|
command: |
|
|
|
|
~/build/test/evmc-vmtester target/debug/libexamplerustvm.so
|
2019-08-08 19:43:04 +00:00
|
|
|
- run:
|
|
|
|
name: Test with evmc-example
|
|
|
|
command: |
|
2019-08-08 11:21:04 +00:00
|
|
|
~/build/examples/evmc-example target/debug/libexamplerustvm.so
|
2018-08-20 10:15:09 +00:00
|
|
|
|
2019-06-04 14:28:06 +00:00
|
|
|
bindings-rust-asan-combined:
|
|
|
|
docker:
|
2019-08-20 22:37:38 +00:00
|
|
|
- image: rust:1-buster
|
2019-06-04 14:28:06 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Update environment
|
|
|
|
command: |
|
2019-08-20 22:34:03 +00:00
|
|
|
echo 'deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main' >> /etc/apt/sources.list
|
2019-08-07 13:23:43 +00:00
|
|
|
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
2019-06-19 08:19:21 +00:00
|
|
|
apt -qq update
|
|
|
|
apt -yq install llvm-8-dev clang-8
|
2019-06-04 14:28:06 +00:00
|
|
|
rustup toolchain install nightly-x86_64-unknown-linux-gnu
|
|
|
|
rustup update
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: RUSTFLAGS="-Z sanitizer=address" ASAN_OPTIONS=detect_leaks=1 cargo +nightly build --target x86_64-unknown-linux-gnu
|
|
|
|
- run:
|
|
|
|
name: Test
|
|
|
|
command: RUSTFLAGS="-Z sanitizer=address -C opt-level=0" ASAN_OPTIONS=detect_leaks=1 cargo +nightly test --target x86_64-unknown-linux-gnu
|
|
|
|
- attach_workspace:
|
|
|
|
at: ~/build
|
|
|
|
- run:
|
|
|
|
name: Test with evmc-vmtester
|
|
|
|
command: |
|
2019-06-19 08:19:21 +00:00
|
|
|
~/build/test/evmc-vmtester target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
|
2019-08-08 19:43:04 +00:00
|
|
|
- run:
|
|
|
|
name: Test with evmc-example
|
|
|
|
command: |
|
2019-08-08 11:21:04 +00:00
|
|
|
~/build/examples/evmc-example target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
|
2019-06-04 14:28:06 +00:00
|
|
|
|
2018-03-28 13:20:39 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
evmc:
|
|
|
|
jobs:
|
2018-08-28 13:04:21 +00:00
|
|
|
- lint
|
2019-01-15 13:00:25 +00:00
|
|
|
- build-cxx17
|
2019-04-29 13:21:07 +00:00
|
|
|
- build-cxx14-asan
|
2019-03-11 21:33:43 +00:00
|
|
|
- build-gcc6
|
2019-06-25 11:28:07 +00:00
|
|
|
- build-clang38
|
2019-06-25 09:25:53 +00:00
|
|
|
- build-32bit
|
2019-03-13 21:29:58 +00:00
|
|
|
- bindings-go-latest
|
|
|
|
- bindings-go-min
|
2019-04-23 19:47:21 +00:00
|
|
|
- bindings-rust:
|
|
|
|
requires:
|
|
|
|
- build-cxx17
|
2019-06-04 14:28:06 +00:00
|
|
|
- bindings-rust-asan-combined:
|
|
|
|
requires:
|
|
|
|
- build-cxx14-asan
|
2018-03-28 15:01:47 +00:00
|
|
|
- upload-docs:
|
|
|
|
requires:
|
2019-06-25 11:49:10 +00:00
|
|
|
- lint
|
2018-03-28 15:01:47 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|