mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
1705 lines
55 KiB
YAML
1705 lines
55 KiB
YAML
# vim:ts=2:sw=2:et
|
|
# --------------------------------------------------------------------------
|
|
# Prefixes used in order to keep CircleCI workflow overview more readable:
|
|
# - b: build
|
|
# - t: test
|
|
# - ubu: ubuntu
|
|
# - ems: Emscripten
|
|
version: 2.1
|
|
parameters:
|
|
ubuntu-2204-docker-image:
|
|
type: string
|
|
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-1
|
|
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:07419ed58537cbca9d4c30701fb84f6bb517ce2fce7f3b5dccb3db8bf1c30183"
|
|
ubuntu-2204-clang-docker-image:
|
|
type: string
|
|
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-1
|
|
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e515710752bfb38ee0e9b2f92ca71612c03ed85290c36c3b3c0a3d9f90187aef"
|
|
ubuntu-1604-clang-ossfuzz-docker-image:
|
|
type: string
|
|
# solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-22
|
|
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:baf46ad78b131eb6b0bf98d50e9330437a338c6893b53af3853b36f6f4ab18ae"
|
|
emscripten-docker-image:
|
|
type: string
|
|
# solbuildpackpusher/solidity-buildpack-deps:emscripten-14
|
|
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:d7d4ec28cdc3e61fc6a048b88ebdff1c5e67f3353cf1739cbaea07ec2481eb16"
|
|
evm-version:
|
|
type: string
|
|
default: london
|
|
|
|
orbs:
|
|
win: circleci/windows@2.2.0
|
|
|
|
commands:
|
|
gitter_notify_unless_pr:
|
|
description: "Posts a notification to the main room on Gitter (if not running on a PR)."
|
|
parameters:
|
|
event:
|
|
type: enum
|
|
enum: ["failure", "success", "release"]
|
|
condition:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: "Gitter notification"
|
|
when: << parameters.condition >>
|
|
command: |
|
|
# FIXME: Checking $CIRCLE_PULL_REQUEST would be better than hard-coding branch names
|
|
# but it's broken. CircleCI associates runs on develop/breaking with random old PRs.
|
|
[[ $CIRCLE_BRANCH == develop || $CIRCLE_BRANCH == breaking ]] || { echo "Running on a PR or a feature branch - notification skipped."; exit 0; }
|
|
|
|
# Workflow name is not exposed as an env variable. Has to be queried from the API.
|
|
# The name is not critical so if anything fails, use the raw workflow ID as a fallback.
|
|
workflow_info=$(curl --silent "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}") || true
|
|
workflow_name=$(echo "$workflow_info" | grep -E '"\s*name"\s*:\s*".*"' | cut -d \" -f 4 || echo "$CIRCLE_WORKFLOW_ID")
|
|
|
|
[[ $CIRCLE_NODE_TOTAL == 1 ]] && job="**${CIRCLE_JOB}**"
|
|
[[ $CIRCLE_NODE_TOTAL != 1 ]] && job="**${CIRCLE_JOB}** (run $((CIRCLE_NODE_INDEX + 1))/${CIRCLE_NODE_TOTAL})"
|
|
|
|
[[ "<< parameters.event >>" == "failure" ]] && message=" ❌ [${workflow_name}] Job ${job} failed on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
|
|
[[ "<< parameters.event >>" == "success" ]] && message=" ✅ [${workflow_name}] Job ${job} succeeded on **${CIRCLE_BRANCH}**. Please see [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}) for details."
|
|
[[ "<< parameters.event >>" == "release" ]] && message=" 📦 Release binaries for version **${CIRCLE_TAG}** are ready and attached as artifacts to [build ${CIRCLE_BUILD_NUM}](${CIRCLE_BUILD_URL}). **Please make sure the whole workflow succeeded before using them.**"
|
|
|
|
# The release notification only makes sense on tagged commits. If the commit is untagged, just bail out.
|
|
[[ "<< parameters.event >>" == "release" ]] && { [[ $CIRCLE_TAG != "" ]] || { echo "Not a tagged commit - notification skipped."; exit 0; } }
|
|
|
|
curl "https://api.gitter.im/v1/rooms/${GITTER_NOTIFY_ROOM_ID}/chatMessages" \
|
|
--request POST \
|
|
--include \
|
|
--header "Content-Type: application/json" \
|
|
--header "Accept: application/json" \
|
|
--header "Authorization: Bearer ${GITTER_API_TOKEN}" \
|
|
--data "{\"text\":\"${message}\"}"
|
|
|
|
gitter_notify_failure_unless_pr:
|
|
description: "Posts a failure notification to the main room on Gitter (if not running on a PR)."
|
|
steps:
|
|
- gitter_notify_unless_pr:
|
|
event: failure
|
|
condition: on_fail
|
|
|
|
gitter_notify_success_unless_pr:
|
|
description: "Posts a success notification to the main room on Gitter (if not running on a PR)."
|
|
steps:
|
|
- gitter_notify_unless_pr:
|
|
event: success
|
|
condition: on_success
|
|
|
|
gitter_notify_release_unless_pr:
|
|
description: "Posts a release notification to the main room on Gitter (if not running on a PR)."
|
|
steps:
|
|
- gitter_notify_unless_pr:
|
|
event: release
|
|
condition: on_success
|
|
|
|
prepare_bytecode_report:
|
|
description: "Generate bytecode report and upload it as an artifact."
|
|
parameters:
|
|
label:
|
|
type: string
|
|
steps:
|
|
- run: mkdir test-cases/
|
|
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
|
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file "../bytecode-report-<< parameters.label >>-json.txt"
|
|
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file "../bytecode-report-<< parameters.label >>-cli.txt"
|
|
- store_artifacts:
|
|
path: bytecode-report-<< parameters.label >>-json.txt
|
|
- store_artifacts:
|
|
path: bytecode-report-<< parameters.label >>-cli.txt
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- bytecode-report-<< parameters.label >>-json.txt
|
|
- bytecode-report-<< parameters.label >>-cli.txt
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
defaults:
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Build Templates
|
|
|
|
- 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: scripts/ci/build.sh
|
|
|
|
- run_build_ossfuzz: &run_build_ossfuzz
|
|
name: Build_ossfuzz
|
|
command: scripts/ci/build_ossfuzz.sh
|
|
|
|
- run_proofs: &run_proofs
|
|
name: Correctness proofs for optimization rules
|
|
command: scripts/run_proofs.sh
|
|
|
|
- run_soltest: &run_soltest
|
|
name: soltest
|
|
no_output_timeout: 30m
|
|
command: ./.circleci/soltest.sh
|
|
|
|
- run_soltest_all: &run_soltest_all
|
|
name: soltest_all
|
|
no_output_timeout: 30m
|
|
command: ./.circleci/soltest_all.sh
|
|
|
|
- run_cmdline_tests: &run_cmdline_tests
|
|
name: command line tests
|
|
no_output_timeout: 30m
|
|
command: ./test/cmdlineTests.sh
|
|
|
|
- run_docs_pragma_min_version: &run_docs_pragma_min_version
|
|
name: docs pragma version check
|
|
command: ./scripts/docs_version_pragma_check.sh
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Artifacts Templates
|
|
|
|
# the whole build directory
|
|
- artifacts_build_dir: &artifacts_build_dir
|
|
root: build
|
|
paths:
|
|
- "*"
|
|
|
|
# compiled solc executable target
|
|
- artifacts_solc: &artifacts_solc
|
|
path: build/solc/solc
|
|
destination: solc
|
|
|
|
# windows artifacts
|
|
- artifact_solc_windows: &artifact_solc_windows
|
|
path: upload/
|
|
|
|
- artifact_yul_phaser: &artifact_yul_phaser
|
|
path: build/tools/yul-phaser
|
|
destination: yul-phaser
|
|
|
|
# compiled executable targets
|
|
- artifacts_executables: &artifacts_executables
|
|
root: build
|
|
paths:
|
|
- solc/solc
|
|
- test/soltest
|
|
- test/tools/solfuzzer
|
|
|
|
# compiled OSSFUZZ targets
|
|
- artifacts_executables_ossfuzz: &artifacts_executables_ossfuzz
|
|
root: build
|
|
paths:
|
|
- test/tools/ossfuzz/abiv2_proto_ossfuzz
|
|
- test/tools/ossfuzz/abiv2_isabelle_ossfuzz
|
|
- test/tools/ossfuzz/const_opt_ossfuzz
|
|
- test/tools/ossfuzz/solc_mutator_ossfuzz
|
|
- test/tools/ossfuzz/solc_ossfuzz
|
|
- test/tools/ossfuzz/stack_reuse_codegen_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_diff_custom_mutate_ossfuzz
|
|
- test/tools/ossfuzz/yul_proto_ossfuzz
|
|
- test/tools/ossfuzz/sol_proto_ossfuzz
|
|
|
|
# test result output directory
|
|
- artifacts_test_results: &artifacts_test_results
|
|
path: test_results/
|
|
destination: test_results/
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Step Templates
|
|
|
|
# store_test_results helper
|
|
- store_test_results: &store_test_results
|
|
path: test_results/
|
|
|
|
- steps_soltest: &steps_soltest
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
# NOTE: Different build jobs produce different soltest executables (release/debug,
|
|
# clang/gcc, windows/linux/macos, etc.). The executable used by these steps comes from the
|
|
# attached workspace and we only see the items added to the workspace by jobs we depend on.
|
|
- run: *run_soltest
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
- steps_test_lsp: &steps_test_lsp
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: Install dependencies
|
|
command: pip install --user deepdiff colorama
|
|
- run:
|
|
name: Executing solc LSP test suite
|
|
command: ./test/lsp.py ./build/solc/solc --non-interactive
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
- steps_build: &steps_build
|
|
steps:
|
|
- checkout
|
|
- run: *run_build
|
|
- store_artifacts: *artifacts_solc
|
|
- store_artifacts: *artifact_yul_phaser
|
|
- persist_to_workspace: *artifacts_executables
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
- steps_soltest_all: &steps_soltest_all
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run: *run_soltest_all
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
- steps_cmdline_tests: &steps_cmdline_tests
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run: *run_cmdline_tests
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
- steps_install_dependencies_osx: &steps_install_dependencies_osx
|
|
steps:
|
|
# FIXME: We used to cache dependencies on macOS but now it takes longer than just installing
|
|
# them each time. See https://github.com/ethereum/solidity/issues/12925.
|
|
- run:
|
|
name: Install build dependencies
|
|
command: ./.circleci/osx_install_dependencies.sh
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Base Image Templates
|
|
|
|
- base_ubuntu1604_clang: &base_ubuntu1604_clang
|
|
docker:
|
|
- image: << pipeline.parameters.ubuntu-1604-clang-ossfuzz-docker-image >>
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 3
|
|
|
|
- base_ubuntu1604_clang_small: &base_ubuntu1604_clang_small
|
|
<<: *base_ubuntu1604_clang
|
|
resource_class: small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
|
|
- base_ubuntu2204_clang: &base_ubuntu2204_clang
|
|
docker:
|
|
- image: << pipeline.parameters.ubuntu-2204-clang-docker-image >>
|
|
environment:
|
|
TERM: xterm
|
|
CC: clang
|
|
CXX: clang++
|
|
MAKEFLAGS: -j 3
|
|
|
|
- base_ubuntu2204_clang_large: &base_ubuntu2204_clang_large
|
|
<<: *base_ubuntu2204_clang
|
|
resource_class: large
|
|
environment:
|
|
TERM: xterm
|
|
CC: clang
|
|
CXX: clang++
|
|
MAKEFLAGS: -j 5
|
|
|
|
- base_ubuntu2204: &base_ubuntu2204
|
|
docker:
|
|
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 3
|
|
|
|
- base_ubuntu2204_small: &base_ubuntu2204_small
|
|
<<: *base_ubuntu2204
|
|
resource_class: small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
|
|
- base_ubuntu2204_large: &base_ubuntu2204_large
|
|
<<: *base_ubuntu2204
|
|
resource_class: large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 5
|
|
|
|
- base_ubuntu2204_xlarge: &base_ubuntu2204_xlarge
|
|
<<: *base_ubuntu2204
|
|
resource_class: xlarge
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 10
|
|
|
|
- base_cimg_small: &base_cimg_small
|
|
docker:
|
|
- image: cimg/base:current
|
|
resource_class: small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
|
|
- base_archlinux: &base_archlinux
|
|
docker:
|
|
- image: archlinux:base
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 3
|
|
|
|
- base_archlinux_large: &base_archlinux_large
|
|
docker:
|
|
- image: archlinux:base
|
|
resource_class: large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 5
|
|
|
|
- base_win_powershell: &base_win_powershell
|
|
executor:
|
|
name: win/default
|
|
shell: powershell.exe
|
|
|
|
- base_win_powershell_large: &base_win_powershell_large
|
|
executor:
|
|
name: win/default
|
|
shell: powershell.exe
|
|
size: large
|
|
|
|
- base_win_bash: &base_win_bash
|
|
executor:
|
|
name: win/default
|
|
shell: bash.exe
|
|
|
|
- base_osx: &base_osx
|
|
macos:
|
|
xcode: "13.2.0"
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j5
|
|
|
|
- base_osx_large: &base_osx_large
|
|
macos:
|
|
xcode: "13.2.0"
|
|
resource_class: large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j10
|
|
|
|
- base_ems_large: &base_ems_large
|
|
docker:
|
|
- image: << pipeline.parameters.emscripten-docker-image >>
|
|
resource_class: large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 5
|
|
|
|
- base_python_small: &base_python_small
|
|
docker:
|
|
- image: cimg/python:3.6
|
|
resource_class: small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
|
|
- base_node_small: &base_node_small
|
|
docker:
|
|
- image: cimg/node:current
|
|
resource_class: small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Workflow Templates
|
|
|
|
- workflow_trigger_on_tags: &workflow_trigger_on_tags
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
|
|
- workflow_trigger_on_releases: &workflow_trigger_on_releases
|
|
filters:
|
|
tags:
|
|
only: /^v.*/
|
|
branches:
|
|
ignore: /.*/
|
|
|
|
- workflow_ubuntu2204: &workflow_ubuntu2204
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu
|
|
|
|
- workflow_ubuntu1604_clang: &workflow_ubuntu1604_clang
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_ossfuzz
|
|
|
|
- workflow_ubuntu2204_clang: &workflow_ubuntu2204_clang
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_clang
|
|
|
|
- workflow_ubuntu2204_force_release: &workflow_ubuntu2204_force_release
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_force_release
|
|
|
|
- workflow_ubuntu2204_static: &workflow_ubuntu2204_static
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_static
|
|
|
|
- workflow_archlinux: &workflow_archlinux
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_archlinux
|
|
|
|
- workflow_ubuntu2204_codecov: &workflow_ubuntu2204_codecov
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_codecov
|
|
|
|
- workflow_osx: &workflow_osx
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_osx
|
|
|
|
- workflow_ubuntu2204_asan: &workflow_ubuntu2204_asan
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_asan
|
|
|
|
- workflow_ubuntu2204_asan_clang: &workflow_ubuntu2204_asan_clang
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_asan_clang
|
|
|
|
- workflow_ubuntu2204_ubsan_clang: &workflow_ubuntu2204_ubsan_clang
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_ubsan_clang
|
|
|
|
- workflow_emscripten: &workflow_emscripten
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ems
|
|
|
|
- workflow_ubuntu1604_ossfuzz: &workflow_ubuntu1604_ossfuzz
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu_ossfuzz
|
|
|
|
- workflow_win: &workflow_win
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_win
|
|
|
|
# --------------------------------------------------------------------------
|
|
# Parameterized Job Templates
|
|
|
|
# Separate compile-only runs of those external tests where a full run takes much longer.
|
|
- job_ems_compile_ext_colony: &job_ems_compile_ext_colony
|
|
<<: *workflow_emscripten
|
|
name: t_ems_compile_ext_colony
|
|
project: colony
|
|
binary_type: solcjs
|
|
compile_only: 1
|
|
nodejs_version: '14.20'
|
|
python2: true
|
|
|
|
- job_native_test_ext_gnosis: &job_native_test_ext_gnosis
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_gnosis
|
|
project: gnosis
|
|
binary_type: native
|
|
nodejs_version: '16.18'
|
|
- job_native_test_ext_zeppelin: &job_native_test_ext_zeppelin
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_zeppelin
|
|
project: zeppelin
|
|
binary_type: native
|
|
resource_class: large
|
|
- job_native_test_ext_ens: &job_native_test_ext_ens
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_ens
|
|
project: ens
|
|
binary_type: native
|
|
nodejs_version: '18.11'
|
|
- job_native_test_ext_trident: &job_native_test_ext_trident
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_trident
|
|
project: trident
|
|
binary_type: native
|
|
nodejs_version: '16.18'
|
|
- job_native_test_ext_euler: &job_native_test_ext_euler
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_euler
|
|
project: euler
|
|
binary_type: native
|
|
resource_class: medium
|
|
- job_native_test_ext_yield_liquidator: &job_native_test_ext_yield_liquidator
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_yield_liquidator
|
|
project: yield-liquidator
|
|
binary_type: native
|
|
- job_native_test_ext_bleeps: &job_native_test_ext_bleeps
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_bleeps
|
|
project: bleeps
|
|
binary_type: native
|
|
resource_class: medium
|
|
- job_native_test_ext_pool_together: &job_native_test_ext_pool_together
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_pool_together
|
|
project: pool-together
|
|
binary_type: native
|
|
nodejs_version: '16.18'
|
|
- job_native_test_ext_perpetual_pools: &job_native_test_ext_perpetual_pools
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_perpetual_pools
|
|
project: perpetual-pools
|
|
binary_type: native
|
|
nodejs_version: '18.11'
|
|
- job_native_test_ext_uniswap: &job_native_test_ext_uniswap
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_uniswap
|
|
project: uniswap
|
|
binary_type: native
|
|
nodejs_version: '16.18'
|
|
- job_native_test_ext_prb_math: &job_native_test_ext_prb_math
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_prb_math
|
|
project: prb-math
|
|
binary_type: native
|
|
nodejs_version: '18.11'
|
|
- job_native_test_ext_elementfi: &job_native_test_ext_elementfi
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_elementfi
|
|
project: elementfi
|
|
binary_type: native
|
|
resource_class: medium
|
|
- job_native_test_ext_brink: &job_native_test_ext_brink
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_brink
|
|
project: brink
|
|
binary_type: native
|
|
nodejs_version: '18.11'
|
|
- job_native_test_ext_chainlink: &job_native_test_ext_chainlink
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_chainlink
|
|
project: chainlink
|
|
binary_type: native
|
|
nodejs_version: '16.18'
|
|
resource_class: large # Tests run out of memory on a smaller machine
|
|
- job_native_test_ext_gp2: &job_native_test_ext_gp2
|
|
<<: *workflow_ubuntu2204_static
|
|
name: t_native_test_ext_gp2
|
|
project: gp2
|
|
binary_type: native
|
|
nodejs_version: '18.11'
|
|
- job_ems_test_ext_colony: &job_ems_test_ext_colony
|
|
<<: *workflow_emscripten
|
|
name: t_ems_test_ext_colony
|
|
project: colony
|
|
binary_type: solcjs
|
|
nodejs_version: '14.20'
|
|
resource_class: medium
|
|
python2: true
|
|
|
|
- job_b_ubu_asan_clang: &job_b_ubu_asan_clang
|
|
<<: *workflow_trigger_on_tags
|
|
name: b_ubu_asan_clang
|
|
cmake_options: -DSANITIZE=address
|
|
- job_b_ubu_ubsan_clang: &job_b_ubu_ubsan_clang
|
|
<<: *workflow_trigger_on_tags
|
|
name: b_ubu_ubsan_clang
|
|
cmake_options: -DSANITIZE=address
|
|
|
|
# -----------------------------------------------------------------------------------------------
|
|
jobs:
|
|
|
|
chk_spelling:
|
|
<<: *base_python_small
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
pip install --user codespell
|
|
- run:
|
|
name: Check spelling
|
|
command: ~/.local/bin/codespell --skip "*.enc,.git,Dockerfile*,LICENSE,codespell_whitelist.txt,codespell_ignored_lines.txt" --ignore-words ./scripts/codespell_whitelist.txt --exclude-file ./scripts/codespell_ignored_lines.txt
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_docs_examples:
|
|
<<: *base_node_small
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: JS deps
|
|
command: sudo npm install -g solhint
|
|
- run:
|
|
name: Test Docs examples
|
|
command: ./test/docsCodeStyle.sh
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_coding_style:
|
|
<<: *base_cimg_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install shellcheck
|
|
command: |
|
|
sudo apt -q update
|
|
sudo apt install -y shellcheck
|
|
- run:
|
|
name: Check for C++ coding style
|
|
command: ./scripts/check_style.sh
|
|
- run:
|
|
name: checking shell scripts
|
|
command: ./scripts/chk_shellscripts/chk_shellscripts.sh
|
|
- run:
|
|
name: Check for broken symlinks
|
|
command: ./scripts/check_symlinks.sh
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_errorcodes:
|
|
<<: *base_python_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Check for error codes
|
|
command: ./scripts/error_codes.py --check
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_pylint:
|
|
<<: *base_cimg_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install pip
|
|
command: |
|
|
sudo apt -q update
|
|
sudo apt install -y python3-pip
|
|
- run:
|
|
name: Install pylint and dependencies of the scripts that will be linted
|
|
command: python3 -m pip install
|
|
pylint
|
|
z3-solver
|
|
pygments-lexer-solidity
|
|
parsec
|
|
tabulate
|
|
deepdiff
|
|
colorama
|
|
requests
|
|
- run: pylint --version
|
|
- run:
|
|
name: Linting Python Scripts
|
|
command: ./scripts/pylint_all.py
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_antlr_grammar:
|
|
<<: *base_cimg_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install Java
|
|
command: |
|
|
sudo apt -q update
|
|
sudo apt install -y openjdk-17-jdk
|
|
- run:
|
|
name: Run tests
|
|
command: ./scripts/test_antlr_grammar.sh
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_buglist:
|
|
<<: *base_node_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: JS deps
|
|
command: |
|
|
npm install download
|
|
npm install JSONPath
|
|
npm install mktemp
|
|
- run:
|
|
name: Test buglist
|
|
command: ./test/buglistTests.js
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_proofs:
|
|
<<: *base_cimg_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Z3 python deps
|
|
command: |
|
|
sudo apt-get -qq update
|
|
sudo apt-get -qy install python3-pip
|
|
pip3 install --user z3-solver
|
|
- run: *run_proofs
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
chk_docs_pragma_min_version:
|
|
<<: *base_ubuntu2204_small
|
|
steps:
|
|
- checkout
|
|
- run: *run_docs_pragma_min_version
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ubu_pyscripts:
|
|
<<: *base_ubuntu2204_small
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Python unit tests
|
|
command: python3 test/pyscriptTests.py
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_win_pyscripts:
|
|
<<: *base_win_powershell
|
|
steps:
|
|
- run: git config --global core.autocrlf false
|
|
- checkout
|
|
- run:
|
|
name: Python unit tests
|
|
command: python.exe test/pyscriptTests.py
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_ubu: &b_ubu
|
|
# this runs 2x faster on xlarge but takes 4x more resources (compared to medium).
|
|
# Enough other jobs depend on it that it's worth it though.
|
|
<<: *base_ubuntu2204_xlarge
|
|
<<: *steps_build
|
|
|
|
# x64 ASAN build, for testing for memory related bugs
|
|
b_ubu_asan: &b_ubu_asan
|
|
# Runs slightly faster on large and xlarge but we only run it nightly so efficiency matters more.
|
|
<<: *base_ubuntu2204
|
|
environment:
|
|
CMAKE_OPTIONS: -DSANITIZE=address
|
|
MAKEFLAGS: -j 3
|
|
CMAKE_BUILD_TYPE: Release
|
|
<<: *steps_build
|
|
|
|
b_ubu_clang: &b_ubu_clang
|
|
<<: *base_ubuntu2204_clang_large
|
|
environment:
|
|
TERM: xterm
|
|
CC: clang
|
|
CXX: clang++
|
|
MAKEFLAGS: -j 10
|
|
<<: *steps_build
|
|
|
|
b_ubu_san_clang:
|
|
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
|
|
parameters:
|
|
cmake_options:
|
|
type: string
|
|
<<: *base_ubuntu2204_clang
|
|
environment:
|
|
TERM: xterm
|
|
CC: clang
|
|
CXX: clang++
|
|
MAKEFLAGS: -j 3
|
|
CMAKE_OPTIONS: << parameters.cmake_options >>
|
|
<<: *steps_build
|
|
|
|
b_ubu_force_release: &b_ubu_force_release
|
|
<<: *b_ubu
|
|
environment:
|
|
FORCE_RELEASE: ON
|
|
MAKEFLAGS: -j 10
|
|
|
|
b_ubu_static:
|
|
# On large runs 2x faster than on medium. 3x on xlarge.
|
|
<<: *base_ubuntu2204_xlarge
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 10
|
|
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
|
|
steps:
|
|
- checkout
|
|
- run: *run_build
|
|
- run:
|
|
name: strip binary
|
|
command: strip build/solc/solc
|
|
- store_artifacts: *artifacts_solc
|
|
- persist_to_workspace: *artifacts_executables
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_ubu_codecov:
|
|
# Runs ~30% faster on large but we only run it nightly so efficiency matters more.
|
|
<<: *base_ubuntu2204
|
|
environment:
|
|
COVERAGE: ON
|
|
CMAKE_BUILD_TYPE: Debug
|
|
MAKEFLAGS: -j 3
|
|
steps:
|
|
- checkout
|
|
- run: *run_build
|
|
- persist_to_workspace: *artifacts_executables
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ubu_codecov:
|
|
<<: *base_ubuntu2204_large
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 1
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: "soltest: Syntax Tests"
|
|
command: build/test/soltest -t 'syntaxTest*' -- --testpath test
|
|
- run:
|
|
name: "Code Coverage: Syntax Tests"
|
|
command: codecov --flags syntax --gcov-root build
|
|
- run: *run_soltest
|
|
- run:
|
|
name: "Coverage: All"
|
|
command: codecov --flags all --gcov-root build
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
# Builds in C++20 mode and uses debug build in order to speed up.
|
|
# Do *NOT* store any artifacts or workspace as we don't run tests on this build.
|
|
b_ubu_cxx20:
|
|
<<: *base_ubuntu2204_large
|
|
environment:
|
|
CMAKE_BUILD_TYPE: Debug
|
|
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF
|
|
MAKEFLAGS: -j 10
|
|
steps:
|
|
- checkout
|
|
- run: *run_build
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_ubu_ossfuzz: &b_ubu_ossfuzz
|
|
<<: *base_ubuntu1604_clang
|
|
steps:
|
|
- checkout
|
|
- run: *setup_prerelease_commit_hash
|
|
- run: *run_build_ossfuzz
|
|
- persist_to_workspace: *artifacts_executables_ossfuzz
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ubu_ossfuzz: &t_ubu_ossfuzz
|
|
<<: *base_ubuntu1604_clang_small
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: Regression tests
|
|
command: |
|
|
git clone https://github.com/ethereum/solidity-fuzzing-corpus /tmp/solidity-fuzzing-corpus
|
|
mkdir -p test_results
|
|
scripts/regressions.py -o test_results
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
|
|
b_archlinux:
|
|
<<: *base_archlinux_large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 5
|
|
# Build without Z3. We won't be running SMT tests on Arch because that requires a specific
|
|
# version of Z3 and the one with the official repos is often not the one we need.
|
|
USE_Z3: OFF
|
|
steps:
|
|
- run:
|
|
name: Install build dependencies
|
|
command: |
|
|
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake cvc4 git openssh tar
|
|
- checkout
|
|
- run: *run_build
|
|
- store_artifacts: *artifacts_solc
|
|
- persist_to_workspace: *artifacts_executables
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_osx:
|
|
<<: *base_osx_large
|
|
environment:
|
|
TERM: xterm
|
|
CMAKE_BUILD_TYPE: Release
|
|
MAKEFLAGS: -j10
|
|
steps:
|
|
- checkout
|
|
- when:
|
|
condition: true
|
|
<<: *steps_install_dependencies_osx
|
|
- run: *run_build
|
|
- store_artifacts: *artifacts_solc
|
|
- store_artifacts: *artifact_yul_phaser
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- build/solc/solc
|
|
- build/test/soltest
|
|
- build/test/tools/solfuzzer
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_osx_soltest: &t_osx_soltest
|
|
<<: *base_osx
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 0
|
|
TERM: xterm
|
|
steps:
|
|
- checkout
|
|
- when:
|
|
condition: true
|
|
<<: *steps_install_dependencies_osx
|
|
- attach_workspace:
|
|
at: .
|
|
- run: *run_soltest
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_osx_cli:
|
|
<<: *base_osx
|
|
steps:
|
|
- checkout
|
|
- when:
|
|
condition: true
|
|
<<: *steps_install_dependencies_osx
|
|
- attach_workspace:
|
|
at: .
|
|
- run: *run_cmdline_tests
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_ems:
|
|
<<: *base_ems_large
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 10
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Build
|
|
command: |
|
|
scripts/ci/build_emscripten.sh
|
|
- store_artifacts:
|
|
path: upload/soljson.js
|
|
destination: soljson.js
|
|
- run: mkdir -p workspace
|
|
- run: cp upload/soljson.js workspace/soljson.js
|
|
- run: scripts/get_version.sh > workspace/version.txt
|
|
- persist_to_workspace:
|
|
root: workspace
|
|
paths:
|
|
- soljson.js
|
|
- version.txt
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_docs:
|
|
<<: *base_ubuntu2204_small
|
|
steps:
|
|
- checkout
|
|
- run: *setup_prerelease_commit_hash
|
|
- run:
|
|
name: Build documentation
|
|
command: ./docs/docs.sh
|
|
- store_artifacts:
|
|
path: docs/_build/html/
|
|
destination: docs-html
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ubu_soltest_all: &t_ubu_soltest_all
|
|
<<: *base_ubuntu2204_large
|
|
parallelism: 50
|
|
<<: *steps_soltest_all
|
|
|
|
t_ubu_lsp: &t_ubu_lsp
|
|
<<: *base_ubuntu2204_small
|
|
<<: *steps_test_lsp
|
|
|
|
t_archlinux_soltest: &t_archlinux_soltest
|
|
<<: *base_archlinux
|
|
parallelism: 20
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 0
|
|
TERM: xterm
|
|
# For Archlinux we do not have prebuilt docker images and we would need to build evmone from source,
|
|
# thus we forgo semantics tests to speed things up.
|
|
SOLTEST_FLAGS: --no-semantic-tests --no-smt
|
|
steps:
|
|
- run:
|
|
name: Install runtime dependencies
|
|
command: |
|
|
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake z3 cvc4 git openssh tar
|
|
- when:
|
|
condition: true
|
|
<<: *steps_soltest
|
|
|
|
t_ubu_clang_soltest: &t_ubu_clang_soltest
|
|
<<: *base_ubuntu2204_clang
|
|
parallelism: 20
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 0
|
|
# The high parallelism in this job is causing the SMT tests to run out of memory,
|
|
# so disabling for now.
|
|
SOLTEST_FLAGS: --no-smt
|
|
<<: *steps_soltest
|
|
|
|
t_ubu_force_release_soltest_all: &t_ubu_force_release_soltest_all
|
|
# NOTE: This definition is identical to t_ubu_soltest_all but in the workflow we make it depend on
|
|
# a different job (b_ubu_force_release) so the workspace it attaches contains a different executable.
|
|
<<: *t_ubu_soltest_all
|
|
|
|
t_ubu_cli: &t_ubu_cli
|
|
<<: *base_ubuntu2204_small
|
|
<<: *steps_cmdline_tests
|
|
|
|
t_ubu_force_release_cli: &t_ubu_force_release_cli
|
|
<<: *t_ubu_cli
|
|
|
|
t_ubu_locale:
|
|
<<: *base_ubuntu2204_small
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: Install all locales
|
|
command: |
|
|
apt update --assume-yes
|
|
apt install locales-all --assume-yes --no-install-recommends
|
|
- run: test/localeTest.sh build/solc/solc
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ubu_asan_cli:
|
|
# Runs slightly faster on medium but we only run it nightly so efficiency matters more.
|
|
<<: *base_ubuntu2204
|
|
environment:
|
|
TERM: xterm
|
|
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
|
|
# Suppress CLN memory leak.
|
|
# See: https://github.com/ethereum/solidity/issues/13891 for details.
|
|
LSAN_OPTIONS: suppressions=/root/project/.circleci/cln-asan.supp:print_suppressions=0
|
|
<<: *steps_cmdline_tests
|
|
|
|
t_ubu_asan_soltest:
|
|
<<: *base_ubuntu2204
|
|
parallelism: 20
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 0
|
|
SOLTEST_FLAGS: --no-smt
|
|
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
|
|
# Suppress CLN memory leak.
|
|
# See: https://github.com/ethereum/solidity/issues/13891 for details.
|
|
LSAN_OPTIONS: suppressions=/root/project/.circleci/cln-asan.supp
|
|
<<: *steps_soltest
|
|
|
|
t_ubu_asan_clang_soltest:
|
|
<<: *base_ubuntu2204_clang
|
|
parallelism: 20
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
OPTIMIZE: 0
|
|
SOLTEST_FLAGS: --no-smt
|
|
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2
|
|
<<: *steps_soltest
|
|
|
|
t_ubu_ubsan_clang_soltest:
|
|
<<: *base_ubuntu2204_clang
|
|
parallelism: 20
|
|
environment:
|
|
EVM: << pipeline.parameters.evm-version >>
|
|
SOLTEST_FLAGS: --no-smt
|
|
<<: *steps_soltest
|
|
|
|
t_ubu_ubsan_clang_cli:
|
|
<<: *base_ubuntu2204_clang
|
|
<<: *steps_cmdline_tests
|
|
|
|
t_ems_solcjs:
|
|
# Unlike other t_ems jobs this one actually runs 2x faster on medium (compared to small).
|
|
<<: *base_ubuntu2204
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: /tmp/workspace
|
|
- run:
|
|
name: Install test dependencies
|
|
command: |
|
|
apt-get update
|
|
apt-get install -qqy --no-install-recommends nodejs npm
|
|
- run:
|
|
name: Test solcjs
|
|
no_output_timeout: 30m
|
|
command: |
|
|
node --version
|
|
npm --version
|
|
test/externalTests/solc-js/solc-js.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ems_ext_hardhat:
|
|
<<: *base_node_small
|
|
docker:
|
|
- image: cimg/node:18.11
|
|
environment:
|
|
TERM: xterm
|
|
HARDHAT_TESTS_SOLC_PATH: /tmp/workspace/soljson.js
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: /tmp/workspace
|
|
- run: git clone --depth 1 https://github.com/nomiclabs/hardhat.git
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
cd hardhat
|
|
yarn
|
|
- run:
|
|
name: Run hardhat-core test suite
|
|
command: |
|
|
HARDHAT_TESTS_SOLC_VERSION=$(scripts/get_version.sh)
|
|
export HARDHAT_TESTS_SOLC_VERSION
|
|
|
|
# NOTE: This is expected to work without running `yarn build` first.
|
|
cd hardhat/packages/hardhat-core
|
|
yarn test
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_ems_ext:
|
|
parameters:
|
|
project:
|
|
type: string
|
|
binary_type:
|
|
type: enum
|
|
enum:
|
|
- solcjs
|
|
- native
|
|
compile_only:
|
|
type: integer
|
|
default: 0
|
|
nodejs_version:
|
|
type: string
|
|
default: current
|
|
resource_class:
|
|
type: string
|
|
default: small
|
|
python2:
|
|
type: boolean
|
|
default: false
|
|
docker:
|
|
- image: cimg/node:<<parameters.nodejs_version>>
|
|
resource_class: <<parameters.resource_class>>
|
|
# NOTE: Each external test runs up to 6 independent settings presets. If parallelism is higher than
|
|
# actual preset count, some runs will exit immediately. If it's lower, some runs will get more than one preset.
|
|
parallelism: 6
|
|
environment:
|
|
TERM: xterm
|
|
COMPILE_ONLY: <<parameters.compile_only>>
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: /tmp/workspace
|
|
- run:
|
|
name: Install lsof
|
|
command: |
|
|
# lsof is used by Colony in its stop-blockchain-client.sh script
|
|
sudo apt update
|
|
sudo apt-get --quiet --assume-yes --no-install-recommends install lsof
|
|
- when:
|
|
condition: << parameters.python2 >>
|
|
steps:
|
|
- run:
|
|
name: Install Python 2 and make it the default
|
|
command: |
|
|
# python is used by node-gyp to build native modules (needed for Colony).
|
|
# In the 14.x image node-gyp still requires Python 2.
|
|
sudo apt install python2 --assume-yes --no-install-recommends
|
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
|
|
- when:
|
|
condition:
|
|
equal: [<< parameters.binary_type >>, "solcjs"]
|
|
steps:
|
|
- run:
|
|
name: External <<parameters.project>> tests (solcjs)
|
|
command: |
|
|
test/externalTests/<<parameters.project>>.sh solcjs /tmp/workspace/soljson.js
|
|
- when:
|
|
condition:
|
|
equal: [<< parameters.binary_type >>, "native"]
|
|
steps:
|
|
- run:
|
|
name: External <<parameters.project>> tests (native)
|
|
command: |
|
|
test/externalTests/<<parameters.project>>.sh native /tmp/workspace/solc/solc
|
|
- store_artifacts:
|
|
path: reports/externalTests/
|
|
# persist_to_workspace fails if the directory does not exist and the test script will create
|
|
# it only if it actually has benchmark results.
|
|
- run: mkdir -p reports/externalTests/
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- reports/externalTests/
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
c_ext_benchmarks:
|
|
<<: *base_node_small
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Install dependencies of helper scripts
|
|
command: |
|
|
sudo apt update
|
|
sudo apt install python3-pip --assume-yes --no-install-recommends
|
|
python3 -m pip install requests --user
|
|
- run:
|
|
name: Combine benchmark reports
|
|
command: cat reports/externalTests/benchmark-*.json | scripts/externalTests/merge_benchmarks.sh > reports/externalTests/all-benchmarks.json
|
|
- run:
|
|
name: Summarize reports
|
|
command: cat reports/externalTests/all-benchmarks.json | scripts/externalTests/summarize_benchmarks.sh > reports/externalTests/summarized-benchmarks.json
|
|
- run:
|
|
name: Download reports from base branch
|
|
command: |
|
|
if [[ $CIRCLE_PULL_REQUEST != "" ]]; then
|
|
mkdir reports/externalTests/base-branch/
|
|
cd reports/externalTests/base-branch/
|
|
|
|
pr_id=$(echo "$CIRCLE_PULL_REQUEST" | sed 's|\(.*\)\/||')
|
|
scripts_dir=../../../scripts
|
|
|
|
# Our main goal here is to provide new benchmarks, the diff is optional. When benchmarks from
|
|
# the previous run are not available for whatever reason, we still succeed and just skip the diff.
|
|
# download_benchmarks.py exits with status 2 in that case.
|
|
if "${scripts_dir}/externalTests/download_benchmarks.py" --base-of-pr "$pr_id" || [[ $? == 2 ]]; then
|
|
echo 'export SKIP_BENCHMARK_DIFF=true' >> $BASH_ENV
|
|
fi
|
|
fi
|
|
- run:
|
|
name: Diff benchmarks
|
|
command: |
|
|
if [[ $CIRCLE_PULL_REQUEST != "" && $SKIP_BENCHMARK_DIFF != "true" ]]; then
|
|
cd reports/externalTests/
|
|
mkdir diff/
|
|
scripts_dir=../../scripts
|
|
|
|
"${scripts_dir}/externalTests/benchmark_diff.py" table \
|
|
--output-format markdown \
|
|
--style humanized \
|
|
base-branch/summarized-benchmarks-*.json \
|
|
summarized-benchmarks.json > diff/benchmark-diff-summarized-table-markdown-humanized.md
|
|
"${scripts_dir}/externalTests/benchmark_diff.py" table \
|
|
--output-format markdown \
|
|
--style absolute \
|
|
base-branch/summarized-benchmarks-*.json \
|
|
summarized-benchmarks.json > diff/benchmark-diff-summarized-table-markdown-absolute.md
|
|
"${scripts_dir}/externalTests/benchmark_diff.py" inplace \
|
|
--style absolute \
|
|
base-branch/summarized-benchmarks-*.json \
|
|
summarized-benchmarks.json > diff/benchmark-diff-summarized-inplace-absolute.md
|
|
"${scripts_dir}/externalTests/benchmark_diff.py" inplace \
|
|
--style absolute \
|
|
base-branch/all-benchmarks-*.json \
|
|
all-benchmarks.json > diff/benchmark-diff-all-table-inplace-absolute.md
|
|
fi
|
|
- store_artifacts:
|
|
path: reports/externalTests/all-benchmarks.json
|
|
- store_artifacts:
|
|
path: reports/externalTests/summarized-benchmarks.json
|
|
- store_artifacts:
|
|
path: reports/externalTests/diff/
|
|
- store_artifacts:
|
|
path: reports/externalTests/base-branch/
|
|
|
|
b_win: &b_win
|
|
<<: *base_win_powershell_large
|
|
steps:
|
|
# NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config.
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }}
|
|
# DO NOT EDIT between here and save_cache, but rather edit .\scripts\install_deps.ps1
|
|
# WARNING! If you do edit anything here instead, remember to invalidate the cache manually.
|
|
- run:
|
|
name: "Installing dependencies"
|
|
command: .\scripts\install_deps.ps1
|
|
- save_cache:
|
|
key: dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }}
|
|
paths:
|
|
- .\deps
|
|
- run:
|
|
name: "Building solidity"
|
|
command: .circleci/build_win.ps1
|
|
- run:
|
|
name: "Run solc.exe to make sure build was successful."
|
|
command: .\build\solc\Release\solc.exe --version
|
|
- store_artifacts: *artifact_solc_windows
|
|
- persist_to_workspace:
|
|
root: build
|
|
paths:
|
|
- .\solc\*\solc.exe
|
|
- .\test\*\soltest.exe
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_win_soltest: &t_win_soltest
|
|
<<: *base_win_powershell
|
|
steps:
|
|
# NOTE: Git's default core.autocrlf is fine for running soltest. We get additional coverage
|
|
# for files using CRLF that way.
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run:
|
|
name: "Install evmone"
|
|
command: scripts/install_evmone.ps1
|
|
- run:
|
|
name: "Run soltest"
|
|
command: .circleci/soltest.ps1
|
|
- run:
|
|
name: Install LSP test dependencies
|
|
command: python -m pip install --user deepdiff colorama
|
|
- run:
|
|
name: Inspect lsp.py
|
|
command: Get-Content ./test/lsp.py
|
|
- run:
|
|
name: Executing solc LSP test suite
|
|
command: python ./test/lsp.py .\build\solc\Release\solc.exe --non-interactive
|
|
- store_test_results: *store_test_results
|
|
- store_artifacts: *artifacts_test_results
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_bytecode_ubu:
|
|
<<: *base_ubuntu2204_small
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 2
|
|
LC_ALL: C
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- prepare_bytecode_report:
|
|
label: "ubuntu"
|
|
|
|
b_bytecode_osx:
|
|
<<: *base_osx
|
|
environment:
|
|
TERM: xterm
|
|
MAKEFLAGS: -j 5
|
|
LC_ALL: C
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- prepare_bytecode_report:
|
|
label: "osx"
|
|
|
|
b_bytecode_win:
|
|
<<: *base_win_bash
|
|
environment:
|
|
LC_ALL: C
|
|
steps:
|
|
# NOTE: For bytecode generation we need the input files to be byte-for-byte identical on all
|
|
# platforms so line ending conversions must absolutely be disabled.
|
|
- run: git config --global core.autocrlf false
|
|
- checkout
|
|
- attach_workspace:
|
|
at: build
|
|
- run: mkdir test-cases/
|
|
- run: cd test-cases/ && python ../scripts/isolate_tests.py ../test/
|
|
- run: cd test-cases/ && python ../scripts/bytecodecompare/prepare_report.py ../build/solc/Release/solc.exe --interface standard-json --report-file ../bytecode-report-windows-json.txt
|
|
- run: cd test-cases/ && python ../scripts/bytecodecompare/prepare_report.py ../build/solc/Release/solc.exe --interface cli --report-file ../bytecode-report-windows-cli.txt
|
|
- store_artifacts:
|
|
path: bytecode-report-windows-json.txt
|
|
- store_artifacts:
|
|
path: bytecode-report-windows-cli.txt
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- bytecode-report-windows-json.txt
|
|
- bytecode-report-windows-cli.txt
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
b_bytecode_ems:
|
|
<<: *base_node_small
|
|
environment:
|
|
SOLC_EMSCRIPTEN: "On"
|
|
LC_ALL: C
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: emscripten_build/libsolc
|
|
- run: scripts/bytecodecompare/storebytecode.sh && mv -v report.txt bytecode-report-emscripten.txt
|
|
- store_artifacts:
|
|
path: bytecode-report-emscripten.txt
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- bytecode-report-emscripten.txt
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
t_bytecode_compare:
|
|
<<: *base_ubuntu2204_small
|
|
environment:
|
|
REPORT_FILES: |
|
|
bytecode-report-emscripten.txt
|
|
bytecode-report-ubuntu-json.txt
|
|
bytecode-report-ubuntu-cli.txt
|
|
bytecode-report-osx-json.txt
|
|
bytecode-report-osx-cli.txt
|
|
bytecode-report-windows-json.txt
|
|
bytecode-report-windows-cli.txt
|
|
steps:
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Compare reports
|
|
command: diff --brief --report-identical-files --from-file $REPORT_FILES
|
|
- run:
|
|
name: Print diff
|
|
when: on_fail
|
|
command: diff --unified=0 --report-identical-files --from-file $REPORT_FILES | head --lines 50
|
|
- run:
|
|
name: Install zip
|
|
when: on_fail
|
|
command: |
|
|
apt update --quiet
|
|
apt install zip --assume-yes
|
|
- run:
|
|
name: Bundle reports into a single package
|
|
when: on_fail
|
|
command: zip all-bytecode-reports.zip $REPORT_FILES
|
|
- store_artifacts:
|
|
# NOTE: store_artifacts does not support the 'when' attribute.
|
|
# Fortunately when the artifact does not exist it just says "No artifact files found" and ignores it.
|
|
path: all-bytecode-reports.zip
|
|
- gitter_notify_failure_unless_pr
|
|
|
|
c_release_binaries:
|
|
<<: *base_ubuntu2204
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: workspace
|
|
- run:
|
|
name: Gather and rename binaries from dependent jobs
|
|
command: |
|
|
mkdir github/
|
|
cp workspace/solc/solc github/solc-static-linux
|
|
cp workspace/build/solc/solc github/solc-macos
|
|
cp workspace/solc/Release/solc.exe github/solc-windows.exe
|
|
cp workspace/soljson.js github/soljson.js
|
|
|
|
cd github/
|
|
tar --create --file ../github-binaries.tar *
|
|
- store_artifacts:
|
|
path: github-binaries.tar
|
|
- run:
|
|
name: Rename binaries to solc-bin naming convention
|
|
command: |
|
|
full_version=$(
|
|
github/solc-static-linux --version |
|
|
sed -En 's/^Version: ([0-9.]+.*\+commit\.[0-9a-f]+(\.mod)?).*$/\1/p'
|
|
)
|
|
|
|
mkdir -p solc-bin/{linux-amd64,macosx-amd64,windows-amd64,bin}
|
|
|
|
mv github/solc-static-linux "solc-bin/linux-amd64/solc-linux-amd64-v${full_version}"
|
|
mv github/solc-macos "solc-bin/macosx-amd64/solc-macosx-amd64-v${full_version}"
|
|
mv github/solc-windows.exe "solc-bin/windows-amd64/solc-windows-amd64-v${full_version}.exe"
|
|
mv github/soljson.js "solc-bin/bin/soljson-v${full_version}.js"
|
|
|
|
cd solc-bin/
|
|
tar --create --file ../solc-bin-binaries.tar *
|
|
- store_artifacts:
|
|
path: solc-bin-binaries.tar
|
|
- gitter_notify_failure_unless_pr
|
|
- gitter_notify_release_unless_pr
|
|
|
|
workflows:
|
|
version: 2
|
|
|
|
main:
|
|
jobs:
|
|
# basic checks
|
|
- chk_spelling: *workflow_trigger_on_tags
|
|
- chk_coding_style: *workflow_trigger_on_tags
|
|
# DISABLED FOR 0.6.0 - chk_docs_examples: *workflow_trigger_on_tags
|
|
- chk_buglist: *workflow_trigger_on_tags
|
|
- chk_proofs: *workflow_trigger_on_tags
|
|
- chk_pylint: *workflow_trigger_on_tags
|
|
- chk_errorcodes: *workflow_trigger_on_tags
|
|
- chk_antlr_grammar: *workflow_trigger_on_tags
|
|
- chk_docs_pragma_min_version: *workflow_trigger_on_tags
|
|
- t_ubu_pyscripts: *workflow_trigger_on_tags
|
|
- t_win_pyscripts: *workflow_trigger_on_tags
|
|
|
|
# build-only
|
|
- b_docs: *workflow_trigger_on_tags
|
|
# DISABLED FOR 0.8.18 - b_ubu_cxx20: *workflow_trigger_on_tags
|
|
# Issue: https://github.com/ethereum/solidity/issues/13868
|
|
- b_ubu_ossfuzz: *workflow_trigger_on_tags
|
|
|
|
# OS/X build and tests
|
|
- b_osx: *workflow_trigger_on_tags
|
|
- t_osx_cli: *workflow_osx
|
|
- t_osx_soltest: *workflow_osx
|
|
|
|
# ArchLinux build and tests
|
|
- b_archlinux: *workflow_trigger_on_tags
|
|
- t_archlinux_soltest: *workflow_archlinux
|
|
|
|
# Static build
|
|
- b_ubu_static: *workflow_trigger_on_tags
|
|
|
|
# Ubuntu build and tests
|
|
- b_ubu: *workflow_trigger_on_tags
|
|
- t_ubu_cli: *workflow_ubuntu2204
|
|
- t_ubu_locale: *workflow_ubuntu2204
|
|
- t_ubu_soltest_all: *workflow_ubuntu2204
|
|
- b_ubu_clang: *workflow_trigger_on_tags
|
|
- t_ubu_clang_soltest: *workflow_ubuntu2204_clang
|
|
- t_ubu_lsp: *workflow_ubuntu2204
|
|
|
|
# Ubuntu fake release build and tests
|
|
- b_ubu_force_release: *workflow_trigger_on_tags
|
|
- t_ubu_force_release_cli: *workflow_ubuntu2204_force_release
|
|
- t_ubu_force_release_soltest_all: *workflow_ubuntu2204_force_release
|
|
|
|
# Emscripten build and tests that take 15 minutes or less
|
|
- b_ems: *workflow_trigger_on_tags
|
|
- t_ems_solcjs: *workflow_emscripten
|
|
- t_ems_ext_hardhat: *workflow_emscripten
|
|
|
|
- t_ems_ext: *job_ems_compile_ext_colony
|
|
|
|
- t_ems_ext: *job_native_test_ext_gnosis
|
|
- t_ems_ext: *job_native_test_ext_zeppelin
|
|
- t_ems_ext: *job_native_test_ext_ens
|
|
- t_ems_ext: *job_native_test_ext_trident
|
|
- t_ems_ext: *job_native_test_ext_euler
|
|
- t_ems_ext: *job_native_test_ext_yield_liquidator
|
|
- t_ems_ext: *job_native_test_ext_bleeps
|
|
- t_ems_ext: *job_native_test_ext_pool_together
|
|
- t_ems_ext: *job_native_test_ext_perpetual_pools
|
|
- t_ems_ext: *job_native_test_ext_uniswap
|
|
- t_ems_ext: *job_native_test_ext_prb_math
|
|
- t_ems_ext: *job_native_test_ext_elementfi
|
|
- t_ems_ext: *job_native_test_ext_brink
|
|
- t_ems_ext: *job_native_test_ext_chainlink
|
|
- t_ems_ext: *job_native_test_ext_gp2
|
|
|
|
- c_ext_benchmarks:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- t_ems_compile_ext_colony
|
|
- t_native_test_ext_gnosis
|
|
- t_native_test_ext_zeppelin
|
|
- t_native_test_ext_ens
|
|
- t_native_test_ext_trident
|
|
- t_native_test_ext_euler
|
|
- t_native_test_ext_yield_liquidator
|
|
- t_native_test_ext_bleeps
|
|
- t_native_test_ext_pool_together
|
|
- t_native_test_ext_perpetual_pools
|
|
- t_native_test_ext_uniswap
|
|
- t_native_test_ext_prb_math
|
|
- t_native_test_ext_elementfi
|
|
- t_native_test_ext_brink
|
|
- t_native_test_ext_chainlink
|
|
- t_native_test_ext_gp2
|
|
|
|
# Windows build and tests
|
|
- b_win: *workflow_trigger_on_tags
|
|
- t_win_soltest: *workflow_win
|
|
|
|
# Bytecode comparison:
|
|
- b_bytecode_ubu:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ubu
|
|
- b_bytecode_win:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_win
|
|
- b_bytecode_osx:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_osx
|
|
- b_bytecode_ems:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_ems
|
|
- t_bytecode_compare:
|
|
<<: *workflow_trigger_on_tags
|
|
requires:
|
|
- b_bytecode_ubu
|
|
- b_bytecode_win
|
|
- b_bytecode_osx
|
|
- b_bytecode_ems
|
|
|
|
# Final artifacts
|
|
- c_release_binaries:
|
|
<<: *workflow_trigger_on_releases
|
|
requires:
|
|
- b_ubu_static
|
|
- b_osx
|
|
- b_win
|
|
- b_ems
|
|
|
|
nightly:
|
|
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 0 * * *"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- develop
|
|
|
|
jobs:
|
|
# OSSFUZZ builds and (regression) tests
|
|
- b_ubu_ossfuzz: *workflow_trigger_on_tags
|
|
- t_ubu_ossfuzz: *workflow_ubuntu1604_ossfuzz
|
|
|
|
# Code Coverage enabled build and tests
|
|
- b_ubu_codecov: *workflow_trigger_on_tags
|
|
- t_ubu_codecov: *workflow_ubuntu2204_codecov
|
|
|
|
# ASan build and tests
|
|
- b_ubu_asan: *workflow_trigger_on_tags
|
|
- b_ubu_san_clang: *job_b_ubu_asan_clang
|
|
- t_ubu_asan_soltest: *workflow_ubuntu2204_asan
|
|
- t_ubu_asan_clang_soltest: *workflow_ubuntu2204_asan_clang
|
|
- t_ubu_asan_cli: *workflow_ubuntu2204_asan
|
|
|
|
# UBSan build and tests
|
|
- b_ubu_san_clang: *job_b_ubu_ubsan_clang
|
|
- t_ubu_ubsan_clang_soltest: *workflow_ubuntu2204_ubsan_clang
|
|
- t_ubu_ubsan_clang_cli: *workflow_ubuntu2204_ubsan_clang
|
|
|
|
# Emscripten build and tests that take more than 15 minutes to execute
|
|
- b_ems: *workflow_trigger_on_tags
|
|
- t_ems_ext: *job_ems_test_ext_colony
|