Skip to content

Commit 0f05b14

Browse files
yatharthagoenkacameel
authored andcommitted
CI: shared build and dependency installation steps
1 parent 5c3bcb6 commit 0f05b14

File tree

1 file changed

+27
-35
lines changed

1 file changed

+27
-35
lines changed

.circleci/config.yml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ defaults:
214214
command: ./test/lsp.py ./build/solc/solc
215215
- gitter_notify_failure_unless_pr
216216

217+
- steps_build: &steps_build
218+
steps:
219+
- checkout
220+
- run: *run_build
221+
- store_artifacts: *artifacts_solc
222+
- persist_to_workspace: *artifacts_executables
223+
- gitter_notify_failure_unless_pr
224+
217225
- steps_soltest_all: &steps_soltest_all
218226
steps:
219227
- checkout
@@ -234,6 +242,14 @@ defaults:
234242
- store_artifacts: *artifacts_test_results
235243
- gitter_notify_failure_unless_pr
236244

245+
- steps_install_dependencies_osx: &steps_install_dependencies_osx
246+
steps:
247+
- restore_cache:
248+
keys:
249+
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
250+
- attach_workspace:
251+
at: .
252+
237253
# --------------------------------------------------------------------------
238254
# Base Image Templates
239255

@@ -748,12 +764,7 @@ jobs:
748764
CMAKE_OPTIONS: -DSANITIZE=address
749765
MAKEFLAGS: -j 3
750766
CMAKE_BUILD_TYPE: Release
751-
steps:
752-
- checkout
753-
- run: *run_build
754-
- store_artifacts: *artifacts_solc
755-
- persist_to_workspace: *artifacts_executables
756-
- gitter_notify_failure_unless_pr
767+
<<: *steps_build
757768

758769
b_ubu_clang: &b_ubu_clang
759770
<<: *base_ubuntu2004_clang_large
@@ -762,12 +773,7 @@ jobs:
762773
CC: clang
763774
CXX: clang++
764775
MAKEFLAGS: -j 10
765-
steps:
766-
- checkout
767-
- run: *run_build
768-
- store_artifacts: *artifacts_solc
769-
- persist_to_workspace: *artifacts_executables
770-
- gitter_notify_failure_unless_pr
776+
<<: *steps_build
771777

772778
b_ubu_asan_clang: &b_ubu_asan_clang
773779
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
@@ -777,12 +783,7 @@ jobs:
777783
CXX: clang++
778784
CMAKE_OPTIONS: -DSANITIZE=address
779785
MAKEFLAGS: -j 3
780-
steps:
781-
- checkout
782-
- run: *run_build
783-
- store_artifacts: *artifacts_solc
784-
- persist_to_workspace: *artifacts_executables
785-
- gitter_notify_failure_unless_pr
786+
<<: *steps_build
786787

787788
b_ubu_ubsan_clang: &b_ubu_ubsan_clang
788789
# This runs a bit faster on large and xlarge but on nightly efficiency matters more.
@@ -792,12 +793,7 @@ jobs:
792793
CXX: clang++
793794
CMAKE_OPTIONS: -DSANITIZE=undefined
794795
MAKEFLAGS: -j 3
795-
steps:
796-
- checkout
797-
- run: *run_build
798-
- store_artifacts: *artifacts_solc
799-
- persist_to_workspace: *artifacts_executables
800-
- gitter_notify_failure_unless_pr
796+
<<: *steps_build
801797

802798
b_ubu_release: &b_ubu_release
803799
<<: *b_ubu
@@ -949,19 +945,17 @@ jobs:
949945
- build/test/tools/solfuzzer
950946
- gitter_notify_failure_unless_pr
951947

952-
t_osx_soltest:
948+
t_osx_soltest: &t_osx_soltest
953949
<<: *base_osx
954950
environment:
955951
EVM: << pipeline.parameters.evm-version >>
956952
OPTIMIZE: 0
957953
TERM: xterm
958954
steps:
959955
- checkout
960-
- restore_cache:
961-
keys:
962-
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
963-
- attach_workspace:
964-
at: .
956+
- when:
957+
condition: true
958+
<<: *steps_install_dependencies_osx
965959
- run: *run_soltest
966960
- store_test_results: *store_test_results
967961
- store_artifacts: *artifacts_test_results
@@ -971,11 +965,9 @@ jobs:
971965
<<: *base_osx
972966
steps:
973967
- checkout
974-
- restore_cache:
975-
keys:
976-
- dependencies-osx-{{ arch }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
977-
- attach_workspace:
978-
at: .
968+
- when:
969+
condition: true
970+
<<: *steps_install_dependencies_osx
979971
- run: *run_cmdline_tests
980972
- store_artifacts: *artifacts_test_results
981973
- gitter_notify_failure_unless_pr

0 commit comments

Comments
 (0)