solidity/.circleci/config.yml

1735 lines
56 KiB
YAML
Raw Normal View History

# 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-2004-docker-image:
type: string
2023-03-28 12:36:47 +00:00
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-17
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:87c63f4c0e9be15b60417809cd3245892db281af0f80ed7378a1978f6f170029"
ubuntu-2204-docker-image:
type: string
2023-03-28 12:36:47 +00:00
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-2
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:7f0b62da2aa0920660e67cd17fb3a7f6c57d7da72454003056f3bd27bbda2075"
ubuntu-2204-clang-docker-image:
type: string
2023-02-17 10:16:50 +00:00
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204.clang-1
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e515710752bfb38ee0e9b2f92ca71612c03ed85290c36c3b3c0a3d9f90187aef"
ubuntu-clang-ossfuzz-docker-image:
type: string
2023-02-17 10:16:50 +00:00
# solbuildpackpusher/solidity-buildpack-deps:ubuntu.clang.ossfuzz-23
2023-03-28 12:36:47 +00:00
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:7a84f67829ec2fdcfc8a61ebf22f9dc27b04a9edeb1531565ab3e0ebb1cbc4a0"
2020-07-15 10:44:35 +00:00
emscripten-docker-image:
type: string
2023-03-28 12:36:47 +00:00
# solbuildpackpusher/solidity-buildpack-deps:emscripten-15
2023-03-28 12:36:56 +00:00
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:e2729bd6c0734bb49d04e2688fec3dcf880394f351f69358dd2bd92c0f6fd309"
evm-version:
type: string
default: london
orbs:
win: circleci/windows@2.2.0
commands:
2023-02-27 11:35:53 +00:00
matrix_notify_unless_pr:
description: "Posts a notification to the solidity-dev room on Matrix (if not running on a PR)."
parameters:
event:
type: enum
enum: ["failure", "success", "release"]
condition:
type: string
steps:
- run:
2023-02-27 11:35:53 +00:00
name: "Matrix 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
2021-11-23 16:09:50 +00:00
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; } }
2023-02-27 11:35:53 +00:00
curl "https://${MATRIX_SERVER}/_matrix/client/v3/rooms/${MATRIX_NOTIFY_ROOM_ID}/send/m.room.message" \
--request POST \
--include \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
2023-02-27 11:35:53 +00:00
--header "Authorization: Bearer ${MATRIX_ACCESS_TOKEN}" \
--data "{\"msgtype\":\"m.text\", \"body\":\"${message}\"}"
2023-02-27 11:35:53 +00:00
matrix_notify_failure_unless_pr:
description: "Posts a failure notification to the main room on Matrix (if not running on a PR)."
steps:
2023-02-27 11:35:53 +00:00
- matrix_notify_unless_pr:
event: failure
condition: on_fail
2023-02-27 11:35:53 +00:00
matrix_notify_success_unless_pr:
description: "Posts a success notification to the main room on Matrix (if not running on a PR)."
steps:
2023-02-27 11:35:53 +00:00
- matrix_notify_unless_pr:
event: success
condition: on_success
2023-02-27 11:35:53 +00:00
matrix_notify_release_unless_pr:
description: "Posts a release notification to the main room on Matrix (if not running on a PR)."
steps:
2023-02-27 11:35:53 +00:00
- matrix_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
binary_path:
type: string
steps:
- run: mkdir test-cases/
- run: cd test-cases && python3 ../scripts/isolate_tests.py ../test/
- run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --interface standard-json --report-file "../bytecode-report-<< parameters.label >>-json.txt"
- run: cd test-cases && python3 ../scripts/bytecodecompare/prepare_report.py << parameters.binary_path >> --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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2018-04-03 15:34:38 +00:00
defaults:
# --------------------------------------------------------------------------
# Build Templates
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: scripts/ci/build.sh
- run_build_ossfuzz: &run_build_ossfuzz
name: Build_ossfuzz
command: scripts/ci/build_ossfuzz.sh
2019-06-19 17:25:05 +00:00
- 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
# 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
2021-02-05 11:29:52 +00:00
- 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
2018-04-03 15:34:38 +00:00
# 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
2023-02-27 11:35:53 +00:00
- matrix_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
2023-02-27 11:35:53 +00:00
- matrix_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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
- steps_soltest_all: &steps_soltest_all
2019-09-24 12:31:22 +00:00
steps:
- checkout
- attach_workspace:
at: build
2021-08-19 10:24:51 +00:00
- run: *run_soltest_all
2019-09-24 12:31:22 +00:00
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-09-24 12:31:22 +00:00
- steps_cmdline_tests: &steps_cmdline_tests
steps:
- checkout
- attach_workspace:
at: build
2021-08-19 10:24:51 +00:00
- run: *run_cmdline_tests
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results
2023-02-27 11:35:53 +00:00
- matrix_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_archlinux: &base_archlinux
2021-08-19 10:24:51 +00:00
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_cimg_small: &base_cimg_small
docker:
- image: cimg/base:current
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
2021-08-19 10:24:51 +00:00
- base_ems_large: &base_ems_large
2021-08-19 10:24:51 +00:00
docker:
- image: << pipeline.parameters.emscripten-docker-image >>
resource_class: large
environment:
TERM: xterm
MAKEFLAGS: -j 5
- base_node_small: &base_node_small
docker:
- image: cimg/node:current
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
- 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
2021-08-19 10:24:51 +00:00
- base_python_small: &base_python_small
docker:
- image: cimg/python:3.6
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
2023-02-17 10:16:50 +00:00
- base_ubuntu_clang: &base_ubuntu_clang
docker:
2023-02-17 10:16:50 +00:00
- image: << pipeline.parameters.ubuntu-clang-ossfuzz-docker-image >>
environment:
TERM: xterm
MAKEFLAGS: -j 3
2023-02-17 10:16:50 +00:00
- base_ubuntu_clang_small: &base_ubuntu_clang_small
<<: *base_ubuntu_clang
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
- base_ubuntu2004: &base_ubuntu2004
docker:
- image: << pipeline.parameters.ubuntu-2004-docker-image >>
environment:
TERM: xterm
MAKEFLAGS: -j 3
- base_ubuntu2004_small: &base_ubuntu2004_small
<<: *base_ubuntu2004
resource_class: small
environment:
TERM: xterm
MAKEFLAGS: -j 2
- base_ubuntu2004_xlarge: &base_ubuntu2004_xlarge
<<: *base_ubuntu2004
resource_class: xlarge
environment:
TERM: xterm
MAKEFLAGS: -j 10
- base_ubuntu2204: &base_ubuntu2204
2021-08-19 10:24:51 +00:00
docker:
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
environment:
TERM: xterm
MAKEFLAGS: -j 3
- 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_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_win_bash: &base_win_bash
executor:
name: win/default
shell: bash.exe
- 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
# --------------------------------------------------------------------------
# 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_ubuntu2204_clang: &workflow_ubuntu2204_clang
2019-09-24 12:31:22 +00:00
<<: *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_ubuntu2004_static: &workflow_ubuntu2004_static
<<: *workflow_trigger_on_tags
requires:
- b_ubu_static
2020-09-08 08:28:42 +00:00
- 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
2021-08-19 10:24:51 +00:00
<<: *workflow_trigger_on_tags
requires:
- b_ubu_ubsan_clang
- workflow_emscripten: &workflow_emscripten
<<: *workflow_trigger_on_tags
requires:
- b_ems
2023-02-17 10:16:50 +00:00
- workflow_ubuntu_ossfuzz: &workflow_ubuntu_ossfuzz
<<: *workflow_trigger_on_tags
requires:
- b_ubu_ossfuzz
2020-09-16 14:24:11 +00:00
- 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_ubuntu2004_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_ubuntu2004_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_ubuntu2004_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_ubuntu2004_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_ubuntu2004_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_ubuntu2004_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_ubuntu2004_static
name: t_native_test_ext_bleeps
project: bleeps
binary_type: native
resource_class: medium
2022-01-19 16:02:20 +00:00
- job_native_test_ext_pool_together: &job_native_test_ext_pool_together
<<: *workflow_ubuntu2004_static
2022-01-19 16:02:20 +00:00
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_ubuntu2004_static
name: t_native_test_ext_perpetual_pools
project: perpetual-pools
binary_type: native
nodejs_version: '18.11'
2022-01-14 00:32:28 +00:00
- job_native_test_ext_uniswap: &job_native_test_ext_uniswap
<<: *workflow_ubuntu2004_static
2022-01-14 00:32:28 +00:00
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_ubuntu2004_static
2022-01-17 10:26:57 +00:00
name: t_native_test_ext_prb_math
project: prb-math
binary_type: native
nodejs_version: '18.11'
2022-01-10 14:43:44 +00:00
- job_native_test_ext_elementfi: &job_native_test_ext_elementfi
<<: *workflow_ubuntu2004_static
2022-01-10 14:43:44 +00:00
name: t_native_test_ext_elementfi
project: elementfi
binary_type: native
resource_class: medium
2022-01-19 18:24:24 +00:00
- job_native_test_ext_brink: &job_native_test_ext_brink
<<: *workflow_ubuntu2004_static
2022-01-19 18:24:24 +00:00
name: t_native_test_ext_brink
project: brink
binary_type: native
nodejs_version: '18.11'
2022-01-24 12:50:30 +00:00
- job_native_test_ext_chainlink: &job_native_test_ext_chainlink
<<: *workflow_ubuntu2004_static
2022-01-24 12:50:30 +00:00
name: t_native_test_ext_chainlink
project: chainlink
binary_type: native
nodejs_version: '16.18'
2022-01-24 12:50:30 +00:00
resource_class: large # Tests run out of memory on a smaller machine
2022-01-11 19:26:28 +00:00
- job_native_test_ext_gp2: &job_native_test_ext_gp2
<<: *workflow_ubuntu2004_static
2022-01-11 19:26:28 +00:00
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=undefined
# -----------------------------------------------------------------------------------------------
2017-08-16 19:20:46 +00:00
jobs:
chk_spelling:
<<: *base_python_small
2017-08-16 19:20:46 +00:00
steps:
- checkout
- attach_workspace:
at: build
2017-09-14 21:13:37 +00:00
- run:
name: Install dependencies
2017-09-14 21:13:37 +00:00
command: |
pip install --user codespell
2017-09-14 21:13:37 +00:00
- run:
name: Check spelling
2022-08-18 13:28:12 +00:00
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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-01-31 13:22:02 +00:00
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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
chk_coding_style:
<<: *base_cimg_small
2018-02-08 22:43:05 +00:00
steps:
- checkout
2020-03-31 18:05:58 +00:00
- run:
name: Install shellcheck
command: |
sudo apt -q update
sudo apt install -y shellcheck
2018-02-08 22:43:05 +00:00
- run:
name: Check for C++ coding style
command: ./scripts/check_style.sh
2020-03-31 18:05:58 +00:00
- run:
name: checking shell scripts
command: ./scripts/chk_shellscripts/chk_shellscripts.sh
- run:
name: Check for broken symlinks
command: ./scripts/check_symlinks.sh
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-01-31 13:22:02 +00:00
2020-05-27 10:13:37 +00:00
chk_errorcodes:
<<: *base_python_small
2020-05-27 10:13:37 +00:00
steps:
- checkout
- run:
name: Check for error codes
command: ./scripts/error_codes.py --check
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2020-05-27 10:13:37 +00:00
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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2020-03-11 12:03:57 +00:00
chk_antlr_grammar:
<<: *base_cimg_small
2020-03-11 12:03:57 +00:00
steps:
- checkout
- run:
name: Install Java
command: |
sudo apt -q update
sudo apt install -y openjdk-17-jdk
2020-03-11 12:03:57 +00:00
- run:
name: Run tests
command: ./scripts/test_antlr_grammar.sh
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2020-03-11 12:03:57 +00:00
chk_buglist:
<<: *base_node_small
2018-02-09 16:21:36 +00:00
steps:
- checkout
- run:
name: JS deps
2018-02-09 16:21:36 +00:00
command: |
npm install download
npm install JSONPath
npm install mktemp
- run:
name: Test buglist
command: ./test/buglistTests.js
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
chk_proofs:
<<: *base_cimg_small
steps:
- checkout
2017-09-14 21:13:37 +00:00
- run:
name: Z3 python deps
2017-09-14 21:13:37 +00:00
command: |
sudo apt-get -qq update
sudo apt-get -qy install python3-pip
2020-04-22 08:20:52 +00:00
pip3 install --user z3-solver
- run: *run_proofs
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-01-31 13:22:02 +00:00
chk_docs_pragma_min_version:
<<: *base_ubuntu2204_small
steps:
- checkout
- run: *run_docs_pragma_min_version
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
t_ubu_pyscripts:
<<: *base_ubuntu2204_small
steps:
- checkout
- run:
name: Python unit tests
command: python3 test/pyscriptTests.py
2023-02-27 11:35:53 +00:00
- matrix_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
2023-02-27 11:35:53 +00:00
- matrix_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
2019-09-24 12:31:22 +00:00
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
2021-08-19 10:24:51 +00:00
environment:
TERM: xterm
2021-08-19 10:24:51 +00:00
CC: clang
CXX: clang++
MAKEFLAGS: -j 3
CMAKE_OPTIONS: << parameters.cmake_options >>
<<: *steps_build
2021-08-19 10:24:51 +00:00
b_ubu_force_release: &b_ubu_force_release
<<: *b_ubu
environment:
FORCE_RELEASE: ON
2020-07-28 15:30:40 +00:00
MAKEFLAGS: -j 10
2020-09-30 12:49:27 +00:00
b_ubu_static:
# We temporarily keep building static release binaries on ubuntu 20.04
# to avoid glibc incompatibilities.
# See: https://github.com/ethereum/solidity/issues/13954
# On large runs 2x faster than on medium. 3x on xlarge.
<<: *base_ubuntu2004_xlarge
2020-09-30 12:49:27 +00:00
environment:
TERM: xterm
MAKEFLAGS: -j 10
CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DUSE_Z3_DLOPEN=ON -DUSE_CVC4=OFF -DSOLC_STATIC_STDLIBS=ON
2020-09-30 12:49:27 +00:00
steps:
- checkout
- run: *run_build
- run:
name: strip binary
command: strip build/solc/solc
- store_artifacts:
path: build/solc/solc
destination: solc-static-linux
- run: mv build/solc/solc build/solc/solc-static-linux
- persist_to_workspace:
root: build
paths:
- solc/solc-static-linux
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2020-09-30 12:49:27 +00:00
b_ubu_codecov:
# Runs ~30% faster on large but we only run it nightly so efficiency matters more.
<<: *base_ubuntu2204
2019-04-01 22:38:14 +00:00
environment:
COVERAGE: ON
CMAKE_BUILD_TYPE: Debug
MAKEFLAGS: -j 3
steps:
- checkout
- run: *run_build
2020-10-14 20:51:22 +00:00
- persist_to_workspace: *artifacts_executables
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
t_ubu_codecov:
<<: *base_ubuntu2204_large
environment:
EVM: << pipeline.parameters.evm-version >>
OPTIMIZE: 1
2019-04-01 22:38:14 +00:00
steps:
- checkout
- attach_workspace:
at: build
2019-04-01 22:38:14 +00:00
- run:
name: "soltest: Syntax Tests"
2019-07-17 09:05:44 +00:00
command: build/test/soltest -t 'syntaxTest*' -- --testpath test
2019-04-01 22:38:14 +00:00
- 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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-04-01 22:38:14 +00:00
2019-08-09 09:28:22 +00:00
# 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.
2019-08-09 09:28:22 +00:00
b_ubu_cxx20:
<<: *base_ubuntu2204_large
environment:
CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DCMAKE_CXX_STANDARD=20 -DUSE_CVC4=OFF
MAKEFLAGS: -j 10
2018-02-08 15:12:04 +00:00
steps:
- checkout
2018-05-02 13:42:34 +00:00
- run: *run_build
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
b_ubu_ossfuzz: &b_ubu_ossfuzz
2023-02-17 10:16:50 +00:00
<<: *base_ubuntu_clang
2019-01-31 13:22:02 +00:00
steps:
- checkout
- run: *setup_prerelease_commit_hash
- run: *run_build_ossfuzz
- persist_to_workspace: *artifacts_executables_ossfuzz
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-01-31 13:22:02 +00:00
t_ubu_ossfuzz: &t_ubu_ossfuzz
2023-02-17 10:16:50 +00:00
<<: *base_ubuntu_clang_small
2018-11-08 13:28:25 +00:00
steps:
- checkout
- attach_workspace:
at: build
2018-11-08 13:28:25 +00:00
- run:
name: Regression tests
2018-11-08 13:28:25 +00:00
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
2018-11-08 13:28:25 +00:00
b_archlinux:
<<: *base_archlinux_large
2018-10-16 12:21:18 +00:00
environment:
TERM: xterm
MAKEFLAGS: -j 5
2023-04-05 12:55:57 +00:00
# This can be switched off if we run out of sync with Arch.
USE_Z3: ON
2018-10-16 12:21:18 +00:00
steps:
- run:
name: Install build dependencies
command: |
2022-07-26 15:38:55 +00:00
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake cvc4 git openssh tar
2018-10-16 12:21:18 +00:00
- checkout
- run: *run_build
- store_artifacts: *artifacts_solc
- persist_to_workspace: *artifacts_executables
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2018-10-16 12:21:18 +00:00
b_osx:
<<: *base_osx_large
environment:
TERM: xterm
2020-05-20 16:05:40 +00:00
CMAKE_BUILD_TYPE: Release
MAKEFLAGS: -j10
steps:
- checkout
- when:
condition: true
<<: *steps_install_dependencies_osx
2018-05-02 13:42:34 +00:00
- 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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2019-09-20 00:39:25 +00:00
t_osx_soltest: &t_osx_soltest
<<: *base_osx
2019-09-20 00:39:25 +00:00
environment:
EVM: << pipeline.parameters.evm-version >>
2019-09-20 00:39:25 +00:00
OPTIMIZE: 0
TERM: xterm
steps:
- checkout
- when:
condition: true
<<: *steps_install_dependencies_osx
- attach_workspace:
at: .
2019-09-20 00:39:25 +00:00
- run: *run_soltest
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results
2023-02-27 11:35:53 +00:00
- matrix_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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
b_ems:
<<: *base_ems_large
environment:
TERM: xterm
MAKEFLAGS: -j 10
steps:
- checkout
- run:
name: Build
command: |
2020-10-19 15:57:22 +00:00
scripts/ci/build_emscripten.sh
- store_artifacts:
2021-11-09 17:07:15 +00:00
path: upload/soljson.js
destination: soljson.js
- run: mkdir -p workspace
2021-11-09 17:07:15 +00:00
- 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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
b_docs:
<<: *base_ubuntu2204_small
steps:
- checkout
- run: *setup_prerelease_commit_hash
2018-07-23 11:29:55 +00:00
- run:
name: Build documentation
2022-04-07 12:32:06 +00:00
command: ./docs/docs.sh
2018-10-11 15:01:06 +00:00
- store_artifacts:
path: docs/_build/html/
destination: docs-html
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
t_ubu_soltest_all: &t_ubu_soltest_all
<<: *base_ubuntu2204_large
2021-12-20 18:03:48 +00:00
parallelism: 50
<<: *steps_soltest_all
t_ubu_lsp: &t_ubu_lsp
<<: *base_ubuntu2204_small
<<: *steps_test_lsp
2020-09-08 08:28:42 +00:00
t_archlinux_soltest: &t_archlinux_soltest
<<: *base_archlinux
2021-12-20 18:03:48 +00:00
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.
2022-07-26 15:38:55 +00:00
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
2020-09-08 08:28:42 +00:00
2019-09-24 12:31:22 +00:00
t_ubu_clang_soltest: &t_ubu_clang_soltest
<<: *base_ubuntu2204_clang
2021-12-20 18:03:48 +00:00
parallelism: 20
2019-09-24 12:31:22 +00:00
environment:
EVM: << pipeline.parameters.evm-version >>
2019-09-24 12:31:22 +00:00
OPTIMIZE: 0
2022-08-30 09:02:14 +00:00
# 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
2019-09-24 12:31:22 +00:00
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
2019-01-28 13:51:47 +00:00
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: test/localeTest.sh build/solc/solc
2023-02-27 11:35:53 +00:00
- matrix_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
2018-11-08 13:28:25 +00:00
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
2023-01-30 12:22:58 +00:00
# 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
2018-11-08 13:28:25 +00:00
t_ubu_asan_soltest:
<<: *base_ubuntu2204
2021-12-20 18:03:48 +00:00
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
2023-01-30 12:22:58 +00:00
# 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
2021-12-20 18:03:48 +00:00
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
2021-12-20 18:03:48 +00:00
parallelism: 20
environment:
EVM: << pipeline.parameters.evm-version >>
SOLTEST_FLAGS: --no-smt
<<: *steps_soltest
2021-08-19 10:24:51 +00:00
t_ubu_ubsan_clang_cli:
<<: *base_ubuntu2204_clang
<<: *steps_cmdline_tests
2021-08-19 10:24:51 +00:00
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
2021-05-19 15:35:19 +00:00
apt-get install -qqy --no-install-recommends nodejs npm
- run:
name: Test solcjs
2020-09-08 06:18:27 +00:00
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)
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2018-02-08 15:12:04 +00:00
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
2023-02-27 11:35:53 +00:00
- matrix_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>>
2021-12-09 14:35:16 +00:00
# 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-static-linux
2021-12-17 23:36:30 +00:00
- 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/
2023-02-27 11:35:53 +00:00
- matrix_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/
2020-07-22 14:22:21 +00:00
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
2020-10-16 09:42:20 +00:00
# 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
2020-10-14 20:51:22 +00:00
- persist_to_workspace:
root: build
paths:
- .\solc\*\solc.exe
- .\test\*\soltest.exe
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
t_win_soltest: &t_win_soltest
<<: *base_win_powershell
2020-09-16 14:24:11 +00:00
steps:
# NOTE: Git's default core.autocrlf is fine for running soltest. We get additional coverage
# for files using CRLF that way.
2020-09-16 14:24:11 +00:00
- 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
2020-09-16 14:24:11 +00:00
- store_artifacts: *artifacts_test_results
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
2020-09-16 14:24:11 +00:00
# Note: b_bytecode_ubu_static is required because b_ubu_static and b_ubu
# are currently built on different Ubuntu base images.
# It can be safely removed once we move both to the same Ubuntu version.
b_bytecode_ubu_static:
<<: *base_ubuntu2004_small
environment:
TERM: xterm
MAKEFLAGS: -j 2
LC_ALL: C
steps:
- checkout
- attach_workspace:
at: build
- prepare_bytecode_report:
label: "ubuntu2004-static"
binary_path: "../build/solc/solc-static-linux"
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"
binary_path: "../build/solc/solc"
b_bytecode_osx:
<<: *base_osx
environment:
TERM: xterm
MAKEFLAGS: -j 5
LC_ALL: C
steps:
- checkout
- attach_workspace:
at: .
- prepare_bytecode_report:
label: "osx"
binary_path: "../build/solc/solc"
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
# Ensure windows has python3 alias required by prepare_bytecode_report
- run: ln -s /c/tools/miniconda3/python /c/tools/miniconda3/python3
- attach_workspace:
at: build
- prepare_bytecode_report:
label: "windows"
binary_path: "../build/solc/Release/solc.exe"
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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
t_bytecode_compare:
<<: *base_ubuntu2204_small
environment:
REPORT_FILES: |
bytecode-report-emscripten.txt
bytecode-report-ubuntu2004-static-json.txt
bytecode-report-ubuntu2004-static-cli.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: 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
2023-02-27 11:35:53 +00:00
- matrix_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-static-linux 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}
2022-06-15 16:03:14 +00:00
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
2023-02-27 11:35:53 +00:00
- matrix_notify_failure_unless_pr
- matrix_notify_release_unless_pr
2018-02-08 15:12:04 +00:00
workflows:
version: 2
main:
2018-02-08 15:12:04 +00:00
jobs:
# basic checks
- chk_spelling: *workflow_trigger_on_tags
- chk_coding_style: *workflow_trigger_on_tags
2019-09-16 17:06:50 +00:00
# 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
2020-05-27 10:13:37 +00:00
- chk_errorcodes: *workflow_trigger_on_tags
2020-03-11 12:03:57 +00:00
- 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
2023-01-11 20:46:26 +00:00
# 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
2019-09-20 00:39:25 +00:00
- t_osx_soltest: *workflow_osx
2020-09-08 08:28:42 +00:00
# ArchLinux build and tests
- b_archlinux: *workflow_trigger_on_tags
- t_archlinux_soltest: *workflow_archlinux
2020-09-30 12:49:27 +00:00
# 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
2019-09-24 12:31:22 +00:00
- 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
2022-01-19 16:02:20 +00:00
- t_ems_ext: *job_native_test_ext_pool_together
- t_ems_ext: *job_native_test_ext_perpetual_pools
2022-01-14 00:32:28 +00:00
- t_ems_ext: *job_native_test_ext_uniswap
- t_ems_ext: *job_native_test_ext_prb_math
2022-01-10 14:43:44 +00:00
- t_ems_ext: *job_native_test_ext_elementfi
2022-01-19 18:24:24 +00:00
- t_ems_ext: *job_native_test_ext_brink
2022-01-24 12:50:30 +00:00
- t_ems_ext: *job_native_test_ext_chainlink
2022-01-11 19:26:28 +00:00
- 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
2022-01-19 18:24:24 +00:00
- t_native_test_ext_brink
2022-01-24 12:50:30 +00:00
- t_native_test_ext_chainlink
2022-01-11 19:26:28 +00:00
- 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_static:
<<: *workflow_trigger_on_tags
requires:
- b_ubu_static
- 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_static
- 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
2022-05-24 13:06:53 +00:00
- 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
2023-02-17 10:16:50 +00:00
- t_ubu_ossfuzz: *workflow_ubuntu_ossfuzz
# Code Coverage enabled build and tests
- b_ubu_codecov: *workflow_trigger_on_tags
- t_ubu_codecov: *workflow_ubuntu2204_codecov
2020-08-24 18:11:02 +00:00
# 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
2021-08-19 10:24:51 +00:00
# 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
2021-08-19 10:24:51 +00:00
# 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