evmc/circle.yml

270 lines
7.6 KiB
YAML

version: 2.1
executors:
linux:
docker:
- image: ethereum/cpp-build-env:10
commands:
build_and_test:
steps:
- checkout
- run:
name: "Environment"
command: |
CC=${CC:-cc}
CXX=${CXX:-cpp}
echo CC: $CC
echo CXX: $CXX
$CC --version
$CXX --version
cmake --version
- run:
name: "Configure"
working_directory: ~/build
command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DEVMC_TESTING=ON $CMAKE_OPTIONS
- run:
name: "Build"
command: cmake --build ~/build -- -j4
- run:
name: "Test"
command: |
cmake --build ~/build --target test -- ARGS="-j4 --schedule-random --output-on-failure"
# Test statically linked end-to-end example
~/build/examples/evmc-example-static
# Test dynamically loaded end-to-end example
~/build/examples/evmc-example ~/build/examples/example_vm/libexample-vm.so
- run:
name: "Install"
command: cmake --build ~/build --target install
- run:
name: "Package"
command: |
cmake --build ~/build --target package_source
cmake --build ~/build --target package
mkdir ~/package
mv ~/build/evmc-*.tar.gz ~/package
- store_artifacts:
path: ~/package
destination: package
- persist_to_workspace:
root: ~/build
paths:
- test/evmc-vmtester
- examples/evmc-example
jobs:
lint:
docker:
- image: ethereum/cpp-build-env:12-lint
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: |
codespell --quiet-level=4 --ignore-words=./.codespell-whitelist --skip=.git
- 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
- 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:
docker:
- image: ethereum/cpp-build-env:12-lint
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
build-gcc8-cxx17:
docker:
- image: ethereum/cpp-build-env:12-gcc-8
environment:
CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic
steps:
- build_and_test
build-gcc9-cxx17-ubsan:
docker:
- image: ethereum/cpp-build-env:12-gcc-9
environment:
CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic -DSANITIZE=undefined
steps:
- build_and_test
build-clang9-cxx14-asan:
docker:
- image: ethereum/cpp-build-env:12-clang-9
environment:
CMAKE_OPTIONS: -DTOOLCHAIN=cxx14-pic -DSANITIZE=address
UBSAN_OPTIONS: halt_on_error=1
steps:
- build_and_test
build-gcc6:
docker:
- image: ethereum/cpp-build-env:12-gcc-6
steps:
- build_and_test
build-clang38:
docker:
- image: ethereum/cpp-build-env:12-clang-3.8
steps:
- build_and_test
build-gcc-32bit:
docker:
- image: ethereum/cpp-build-env:12-base
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
bindings-go-latest:
docker:
- image: circleci/golang
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
go generate -v ./bindings/go/evmc
go test -v ./bindings/go/evmc
bindings-go-min:
docker:
- image: circleci/golang:1.9
steps: *bindings-go-steps
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
- attach_workspace:
at: ~/build
- run:
name: Test with evmc-vmtester
command: |
~/build/test/evmc-vmtester target/debug/libexamplerustvm.so
- run:
name: Test with evmc-example
command: |
~/build/examples/evmc-example target/debug/libexamplerustvm.so
bindings-rust-asan-combined:
docker:
- image: rust:1-buster
steps:
- checkout
- run:
name: Update environment
command: |
echo 'deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main' >> /etc/apt/sources.list
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt -qq update
apt -yq install llvm-8-dev clang-8
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: |
~/build/test/evmc-vmtester target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
- run:
name: Test with evmc-example
command: |
~/build/examples/evmc-example target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
workflows:
version: 2
evmc:
jobs:
- lint
- build-gcc8-cxx17
- build-gcc9-cxx17-ubsan
- build-clang9-cxx14-asan
- build-gcc6
- build-clang38
- build-gcc-32bit
- bindings-go-latest
- bindings-go-min
- bindings-rust:
requires:
- build-gcc8-cxx17
- bindings-rust-asan-combined:
requires:
- build-clang9-cxx14-asan
- upload-docs:
requires:
- lint
filters:
branches:
only:
- master