version: 2 jobs: lint: docker: - image: ethereum/cpp-build-env:10 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 - 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 build: &build docker: - image: ethereum/cpp-build-env:10 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 - run: name: "Test" command: cmake --build ~/build --target test -- ARGS="-j4 --schedule-random --output-on-failure" - run: name: "Install" command: cmake --build ~/build --target install - run: name: "Package" command: | 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 build-cxx17: <<: *build environment: CC: gcc-8 CXX: g++-8 CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic build-cxx14-asan: <<: *build environment: CC: clang-8 CXX: clang++-8 CMAKE_OPTIONS: -DTOOLCHAIN=cxx14-pic -DSANITIZE=address build-gcc6: <<: *build environment: CC: gcc-6 CXX: g++-6 build-clang3.8: <<: *build environment: CC: clang-3.8 CXX: clang++-3.8 test-docs: docker: - image: ethereum/cpp-build-env:10 steps: - checkout - 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:10 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 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 workflows: version: 2 evmc: jobs: - lint - build-cxx17 - build-cxx14-asan - build-gcc6 - build-clang3.8 - bindings-go-latest - bindings-go-min - bindings-rust: requires: - build-cxx17 - test-docs - upload-docs: requires: - test-docs filters: branches: only: - master