solidity/.circleci/config.yml

531 lines
16 KiB
YAML
Raw Normal View History

2018-04-03 15:34:38 +00:00
defaults:
# The default for tags is to not run, so we have to explicitly match a filter.
- build_on_tags: &build_on_tags
filters:
tags:
only: /.*/
2018-05-02 13:42:34 +00:00
- setup_prerelease_commit_hash: &setup_prerelease_commit_hash
name: Store commit hash and prerelease
command: |
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
echo -n "$CIRCLE_SHA1" > commit_hash.txt
- run_build: &run_build
name: Build
command: |
mkdir -p build
cd build
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"
2018-12-18 15:19:50 +00:00
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
make -j4
- run_build_ossfuzz: &run_build_ossfuzz
name: Build_ossfuzz
command: |
mkdir -p build
cd build
/src/LPM/external.protobuf/bin/protoc --proto_path=../test/tools/ossfuzz yulProto.proto --cpp_out=../test/tools/ossfuzz
cmake .. -DCMAKE_BUILD_TYPE=Release $CMAKE_OPTIONS
make ossfuzz ossfuzz_proto -j4
- run_tests: &run_tests
name: Tests
command: scripts/tests.sh --junit_report test_results
- run_regressions: &run_regressions
name: Regression tests
command: scripts/regressions.py -o test_results
2018-05-02 13:42:34 +00:00
- solc_artifact: &solc_artifact
path: build/solc/solc
destination: solc
2018-05-02 13:42:34 +00:00
- all_artifacts: &all_artifacts
root: build
paths:
- solc/solc
- test/soltest
- test/tools/solfuzzer
- ossfuzz_artifacts: &ossfuzz_artifacts
root: build
paths:
- test/tools/ossfuzz/const_opt_ossfuzz
- test/tools/ossfuzz/solc_noopt_ossfuzz
- test/tools/ossfuzz/solc_opt_ossfuzz
- test/tools/ossfuzz/strictasm_assembly_ossfuzz
- test/tools/ossfuzz/strictasm_diff_ossfuzz
- test/tools/ossfuzz/strictasm_opt_ossfuzz
- test/tools/ossfuzz/yul_proto_diff_ossfuzz
- test/tools/ossfuzz/yul_proto_ossfuzz
2018-04-03 15:34:38 +00:00
2017-08-16 19:20:46 +00:00
version: 2
jobs:
2018-02-08 15:12:04 +00:00
build_emscripten:
2017-08-16 19:20:46 +00:00
docker:
2019-01-18 16:49:21 +00:00
- image: trzeci/emscripten:sdk-tag-1.38.22-64bit
environment:
TERM: xterm
2017-08-16 19:20:46 +00:00
steps:
- checkout
2017-09-14 21:13:37 +00:00
- restore_cache:
name: Restore Boost build
key: &boost-cache-key emscripten-boost-{{ checksum "scripts/travis-emscripten/install_deps.sh" }}{{ checksum "scripts/build_emscripten.sh" }}{{ checksum "scripts/travis-emscripten/build_emscripten.sh" }}
2017-09-14 21:13:37 +00:00
- run:
name: Bootstrap Boost
command: |
scripts/travis-emscripten/install_deps.sh
- run:
name: Build
command: |
scripts/travis-emscripten/build_emscripten.sh
- save_cache:
name: Save Boost build
key: *boost-cache-key
paths:
- boost_1_68_0
2018-02-08 22:43:05 +00:00
- store_artifacts:
path: emscripten_build/libsolc/soljson.js
2018-02-08 22:43:05 +00:00
destination: soljson.js
- run: mkdir -p workspace
- run: cp emscripten_build/libsolc/soljson.js workspace/soljson.js
2018-02-09 17:08:29 +00:00
- run: scripts/get_version.sh > workspace/version.txt
2018-02-08 22:43:05 +00:00
- persist_to_workspace:
root: workspace
paths:
- soljson.js
2018-02-09 17:08:29 +00:00
- version.txt
2019-01-31 13:22:02 +00:00
2018-02-09 16:21:36 +00:00
test_emscripten_solcjs:
2018-02-08 22:43:05 +00:00
docker:
2018-12-14 22:15:09 +00:00
- image: circleci/node:10
environment:
TERM: xterm
2018-02-08 22:43:05 +00:00
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install external tests deps
command: |
2018-02-09 16:21:36 +00:00
node --version
npm --version
2018-02-08 22:43:05 +00:00
- run:
2018-02-09 16:21:36 +00:00
name: Test solcjs
2018-02-08 22:43:05 +00:00
command: |
2018-02-09 17:08:29 +00:00
test/solcjsTests.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
2019-01-31 13:22:02 +00:00
test_emscripten_external_gnosis:
2018-02-09 16:21:36 +00:00
docker:
2018-12-14 22:15:09 +00:00
- image: circleci/node:10
environment:
TERM: xterm
2018-02-09 16:21:36 +00:00
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External GnosisSafe tests
2018-02-09 16:21:36 +00:00
command: |
test/externalTests/gnosis.sh /tmp/workspace/soljson.js || test/externalTests/gnosis.sh /tmp/workspace/soljson.js
test_emscripten_external_zeppelin:
docker:
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
2017-09-14 21:13:37 +00:00
- run:
name: External Zeppelin tests
2017-09-14 21:13:37 +00:00
command: |
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js || test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
2019-01-31 13:22:02 +00:00
build_x86_linux:
2018-02-08 15:12:04 +00:00
docker:
- image: buildpack-deps:bionic
environment:
TERM: xterm
COVERAGE: "ON"
2018-02-08 15:12:04 +00:00
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
2018-05-02 13:42:34 +00:00
- run: *setup_prerelease_commit_hash
- run: *run_build
- store_artifacts: *solc_artifact
- persist_to_workspace:
root: build
paths:
- "*"
2019-01-31 13:22:02 +00:00
build_x86_linux_cxx17:
docker:
- image: buildpack-deps:disco
2019-01-31 13:22:02 +00:00
environment:
TERM: xterm
CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/cxx17.cmake
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
2019-01-31 13:22:02 +00:00
- run: *setup_prerelease_commit_hash
- run: *run_build
2018-11-08 13:28:25 +00:00
build_x86_archlinux:
docker:
- image: archlinux/base
environment:
TERM: xterm
steps:
- run:
name: Install build dependencies
command: |
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake z3 cvc4 git openssh tar
- checkout
- run: *setup_prerelease_commit_hash
- run: *run_build
- store_artifacts: *solc_artifact
- persist_to_workspace:
root: build
paths:
- solc/solc
- test/soltest
- test/tools/solfuzzer
2019-01-28 13:51:47 +00:00
build_x86_clang7_asan:
2018-10-16 12:21:18 +00:00
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
CC: /usr/bin/clang-7
CXX: /usr/bin/clang++-7
2019-01-28 13:51:47 +00:00
CMAKE_OPTIONS: -DSANITIZE=address -DCMAKE_BUILD_TYPE=Debug
2018-10-16 12:21:18 +00:00
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libjsoncpp-dev=1.7.4-\*
2018-10-16 12:21:18 +00:00
- run: *setup_prerelease_commit_hash
- run: *run_build
2019-01-28 13:51:47 +00:00
- store_artifacts: *solc_artifact
- persist_to_workspace:
root: build
paths:
- solc/solc
- test/soltest
- test/tools/solfuzzer
2018-10-16 12:21:18 +00:00
build_x86_mac:
macos:
2018-10-02 14:40:27 +00:00
xcode: "10.0.0"
environment:
TERM: xterm
2018-11-13 14:35:46 +00:00
CMAKE_OPTIONS: -DLLL=ON
steps:
- checkout
- run:
name: Install build dependencies
2018-03-05 21:56:35 +00:00
command: |
brew unlink python
brew install z3
brew install boost
brew install cmake
brew install wget
./scripts/install_obsolete_jsoncpp_1_7_4.sh
2018-05-02 13:42:34 +00:00
- run: *setup_prerelease_commit_hash
- run: *run_build
- store_artifacts: *solc_artifact
- persist_to_workspace: *all_artifacts
test_check_spelling:
docker:
- image: circleci/python:3.6
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
pip install --user codespell
- run:
name: Check spelling
command: ~/.local/bin/codespell -S "*.enc,.git" -I ./scripts/codespell_whitelist.txt
test_check_style:
docker:
- image: buildpack-deps:bionic
steps:
- checkout
- run:
name: Check for trailing whitespace
command: ./scripts/check_style.sh
test_buglist:
docker:
- image: circleci/node
environment:
TERM: xterm
steps:
- checkout
- run:
name: JS deps
command: |
npm install download
npm install JSONPath
npm install mktemp
- run:
name: Test buglist
command: ./test/buglistTests.js
test_x86_linux:
docker:
- image: buildpack-deps:bionic
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
apt-get -qq update
apt-get -qy install libcvc4-dev libleveldb1v5 python-pip
2018-07-23 11:29:55 +00:00
pip install codecov
2018-02-08 23:36:05 +00:00
- run: mkdir -p test_results
2018-07-23 11:29:55 +00:00
- run:
name: Test type checker
command: build/test/soltest -t 'syntaxTest*' -- --no-ipc --testpath test
- run:
name: Coverage of type checker
2018-07-24 20:27:08 +00:00
command: codecov --flags syntax --gcov-root build
2018-05-02 13:42:34 +00:00
- run: *run_tests
2018-07-23 11:29:55 +00:00
- run:
name: Coverage of all
command: codecov --flags all --gcov-root build
- store_test_results:
path: test_results/
2018-10-11 15:01:06 +00:00
- store_artifacts:
path: test_results/
destination: test_results/
2019-01-28 13:51:47 +00:00
test_x86_clang7_asan:
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
apt-get -qq update
apt-get -qy install llvm-7-dev libcvc4-dev libleveldb1v5 python-pip
# This is needed to resolve the symbols. Since we're using clang7 in the build, we must use the appropriate symbolizer.
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
- run: mkdir -p test_results
- run:
2019-04-17 09:17:53 +00:00
name: Run soltest with ASAN
2019-01-28 13:51:47 +00:00
command: |
ulimit -a
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
ulimit -s 16384
build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test
2019-04-17 09:17:53 +00:00
- run:
name: Run commandline tests with ASAN
command: |
ulimit -a
# Increase stack size because ASan makes stack frames bigger and that breaks our assumptions (in tests).
ulimit -s 16384
test/cmdlineTests.sh
2019-01-28 13:51:47 +00:00
- store_test_results:
path: test_results/
- store_artifacts:
path: test_results/
destination: test_results/
2018-11-08 13:28:25 +00:00
test_x86_archlinux:
docker:
- image: archlinux/base
environment:
TERM: xterm
steps:
- run:
name: Install dependencies
command: |
2018-11-08 18:38:13 +00:00
pacman --noconfirm -Syu --noprogressbar --needed boost z3 cvc4 git openssh tar
2018-11-08 13:28:25 +00:00
- checkout
- attach_workspace:
at: build
- run: mkdir -p test_results
2018-11-08 18:38:13 +00:00
- run: build/test/soltest --logger=JUNIT,test_suite,test_results/result.xml -- --no-ipc --testpath test
2018-11-08 13:28:25 +00:00
- store_test_results:
path: test_results/
- store_artifacts:
path: test_results/
destination: test_results/
test_x86_mac:
macos:
2018-10-02 14:40:27 +00:00
xcode: "10.0.0"
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
brew unlink python
brew install z3
- run: mkdir -p test_results
2018-05-02 13:42:34 +00:00
- run: *run_tests
2018-02-08 23:36:05 +00:00
- store_test_results:
path: test_results/
2018-10-11 15:01:06 +00:00
- store_artifacts:
path: test_results/
destination: test_results/
2018-02-08 15:12:04 +00:00
2018-02-19 16:20:30 +00:00
docs:
docker:
- image: buildpack-deps:bionic
environment:
DEBIAN_FRONTEND: noninteractive
2018-02-19 16:20:30 +00:00
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install python-sphinx python-pip
2018-05-02 13:42:34 +00:00
- run: *setup_prerelease_commit_hash
2018-02-19 16:20:30 +00:00
- run:
name: Build documentation
command: ./scripts/docs.sh
- store_artifacts:
path: docs/_build/html/
destination: docs-html
build_x86_linux_ossfuzz:
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
CC: /usr/bin/clang-7
CXX: /usr/bin/clang++-7
CMAKE_OPTIONS: -DOSSFUZZ=1 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/libfuzzer.cmake
steps:
- checkout
- run:
name: Install build dependencies
command: |
apt-get -qq update
apt-get -qy install clang-7 cmake libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev libboost-program-options-dev libcvc4-dev libbz2-dev ninja-build zlib1g-dev libjsoncpp-dev=1.7.4-\*
./scripts/install_lpm.sh
./scripts/install_libfuzzer.sh
- run: *setup_prerelease_commit_hash
- run: *run_build_ossfuzz
- persist_to_workspace: *ossfuzz_artifacts
test_x86_ossfuzz_regression:
docker:
- image: buildpack-deps:cosmic
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
apt-get -qq update
apt-get -qy install libcvc4-dev llvm-7-dev
./scripts/download_ossfuzz_corpus.sh
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-7 1
- run: mkdir -p test_results
- run: *run_regressions
- store_test_results:
path: test_results/
- store_artifacts:
path: test_results/
destination: test_results/
2018-02-08 15:12:04 +00:00
workflows:
version: 2
build_all:
jobs:
- test_check_spelling: *build_on_tags
- test_check_style: *build_on_tags
- test_buglist: *build_on_tags
2018-04-03 15:34:38 +00:00
- build_emscripten: *build_on_tags
2018-02-09 16:21:36 +00:00
- test_emscripten_solcjs:
2018-04-03 15:34:38 +00:00
<<: *build_on_tags
2018-02-09 16:21:36 +00:00
requires:
- build_emscripten
- test_emscripten_external_zeppelin:
<<: *build_on_tags
requires:
- build_emscripten
- test_emscripten_external_gnosis:
2018-04-03 15:34:38 +00:00
<<: *build_on_tags
2018-02-08 22:43:05 +00:00
requires:
- build_emscripten
- build_x86_linux: *build_on_tags
2019-01-31 13:22:02 +00:00
- build_x86_linux_cxx17: *build_on_tags
2019-01-28 13:51:47 +00:00
- build_x86_clang7_asan: *build_on_tags
- build_x86_mac: *build_on_tags
- test_x86_linux:
<<: *build_on_tags
requires:
- build_x86_linux
2019-01-28 13:51:47 +00:00
- test_x86_clang7_asan:
2019-04-17 09:17:53 +00:00
<<: *build_on_tags
2019-01-28 13:51:47 +00:00
requires:
- build_x86_clang7_asan
- test_x86_mac:
2018-04-03 15:34:38 +00:00
<<: *build_on_tags
requires:
- build_x86_mac
2018-04-03 15:34:38 +00:00
- docs: *build_on_tags
2018-11-08 13:28:25 +00:00
- build_x86_archlinux: *build_on_tags
- test_x86_archlinux:
<<: *build_on_tags
requires:
- build_x86_archlinux
- build_x86_linux_ossfuzz: *build_on_tags
test_nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- develop
jobs:
- build_emscripten: *build_on_tags
- test_emscripten_external_zeppelin:
<<: *build_on_tags
requires:
- build_emscripten
- test_emscripten_external_gnosis:
<<: *build_on_tags
requires:
- build_emscripten
- build_x86_linux_ossfuzz: *build_on_tags
- test_x86_ossfuzz_regression:
<<: *build_on_tags
requires:
- build_x86_linux_ossfuzz