From da17150bec893c32500321d6d5d41ec132da65d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 9 Dec 2020 12:54:38 +0100 Subject: [PATCH] Extract common parts from external job definitions into commands --- .circleci/config.yml | 237 +++++++++++++++---------------------------- 1 file changed, 83 insertions(+), 154 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e6067574..e4df5987c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,172 +802,60 @@ jobs: npm --version test/externalTests/solc-js/solc-js.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt) - t_ems_compile_ext_gnosis: + t_ems_compile_ext: + parameters: + project: + type: string + nodejs_version: + type: integer + default: 14 docker: - - image: circleci/node:14 + - image: circleci/node:<> environment: TERM: xterm + COMPILE_ONLY: 1 steps: - checkout - attach_workspace: at: /tmp/workspace - run: - name: External GnosisSafe compilation + name: External <> compilation command: | - export COMPILE_ONLY=1 - test/externalTests/gnosis.sh /tmp/workspace/soljson.js + test/externalTests/<>.sh /tmp/workspace/soljson.js - t_ems_test_ext_gnosis: + t_ems_test_ext: + parameters: + project: + type: string + nodejs_version: + type: integer + default: 14 + gitter_notify: + type: boolean + default: no docker: - # NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1"). - - image: circleci/node:12 + - image: circleci/node:<> environment: TERM: xterm + COMPILE_ONLY: 0 steps: - checkout - attach_workspace: at: /tmp/workspace - run: - name: External GnosisSafe tests - command: | - test/externalTests/gnosis.sh /tmp/workspace/soljson.js - - t_ems_compile_ext_gnosis_v2: - docker: - - image: circleci/node:14 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: External GnosisSafe v2 compilation - command: | - export COMPILE_ONLY=1 - test/externalTests/gnosis-v2.sh /tmp/workspace/soljson.js - - t_ems_test_ext_gnosis_v2: - docker: - # NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1"). - - image: circleci/node:12 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: External GnosisSafe v2 tests - command: | - test/externalTests/gnosis-v2.sh /tmp/workspace/soljson.js - - t_ems_compile_ext_zeppelin: - docker: - - image: circleci/node:14 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: External Zeppelin compilation - command: | - export COMPILE_ONLY=1 - test/externalTests/zeppelin.sh /tmp/workspace/soljson.js - - t_ems_test_ext_zeppelin: - docker: - - image: circleci/node:14 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: External Zeppelin tests - command: | - test/externalTests/zeppelin.sh /tmp/workspace/soljson.js - - t_ems_compile_ext_colony: - docker: - - image: circleci/node:14 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: Install test dependencies + name: Install dependencies command: | + # lsof is used by Colony in its stop-blockchain-client.sh script sudo apt-get -qy install lsof - run: - name: External ColonyNetworks compilation + name: External <> tests command: | - export COMPILE_ONLY=1 - test/externalTests/colony.sh /tmp/workspace/soljson.js - - t_ems_test_ext_colony: - docker: - - image: circleci/node:14 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: Install test dependencies - command: | - sudo apt-get -qy install lsof - - run: - name: External ColonyNetworks tests - command: | - test/externalTests/colony.sh /tmp/workspace/soljson.js - - run: *gitter_notify_failure - - run: *gitter_notify_success - - t_ems_compile_ext_ens: - docker: - # NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+. - - image: circleci/node:10 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: Install test dependencies - command: | - sudo apt-get -qy install lsof - - run: - name: External Ens compilation - command: | - export COMPILE_ONLY=1 - test/externalTests/ens.sh /tmp/workspace/soljson.js - - t_ems_test_ext_ens: - docker: - # NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+. - - image: circleci/node:10 - environment: - TERM: xterm - steps: - - checkout - - attach_workspace: - at: /tmp/workspace - - run: - name: Install test dependencies - command: | - sudo apt-get -qy install lsof - - run: - name: External Ens compilation - command: | - test/externalTests/ens.sh /tmp/workspace/soljson.js + test/externalTests/<>.sh /tmp/workspace/soljson.js + - when: + condition: <> + steps: + - run: *gitter_notify_failure + - run: *gitter_notify_success b_win: &b_win executor: @@ -1149,17 +1037,54 @@ workflows: # Emscripten build and tests that take 15 minutes or less - b_ems: *workflow_trigger_on_tags - t_ems_solcjs: *workflow_emscripten - - t_ems_compile_ext_colony: *workflow_emscripten - - t_ems_compile_ext_gnosis: *workflow_emscripten - - t_ems_compile_ext_gnosis_v2: *workflow_emscripten - - t_ems_compile_ext_zeppelin: *workflow_emscripten - - t_ems_compile_ext_ens: *workflow_emscripten + + - t_ems_compile_ext: + <<: *workflow_emscripten + name: t_ems_compile_ext_colony + project: colony + - t_ems_compile_ext: + <<: *workflow_emscripten + name: t_ems_compile_ext_gnosis + project: gnosis + - t_ems_compile_ext: + <<: *workflow_emscripten + name: t_ems_compile_ext_gnosis_v2 + project: gnosis-v2 + - t_ems_compile_ext: + <<: *workflow_emscripten + name: t_ems_compile_ext_zeppelin + project: zeppelin + - t_ems_compile_ext: + <<: *workflow_emscripten + name: t_ems_compile_ext_ens + project: ens + # NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+. + nodejs_version: 10 + # FIXME: Gnosis tests are pretty flaky right now. They often fail on CircleCI due to random ProviderError # and there are also other less frequent problems. See https://github.com/gnosis/safe-contracts/issues/216. - #- t_ems_test_ext_gnosis: *workflow_emscripten - - t_ems_test_ext_gnosis_v2: *workflow_emscripten - - t_ems_test_ext_zeppelin: *workflow_emscripten - - t_ems_test_ext_ens: *workflow_emscripten + #- t_ems_test_ext: + # <<: *workflow_emscripten + # name: t_ems_test_ext_gnosis + # project: gnosis + # # NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1"). + # nodejs_version: 12 + - t_ems_test_ext: + <<: *workflow_emscripten + name: t_ems_test_ext_gnosis_v2 + project: gnosis-v2 + # NOTE: Tests do not start on node.js 14 ("ganache-cli exited early with code 1"). + nodejs_version: 12 + - t_ems_test_ext: + <<: *workflow_emscripten + name: t_ems_test_ext_zeppelin + project: zeppelin + - t_ems_test_ext: + <<: *workflow_emscripten + name: t_ems_test_ext_ens + project: ens + # NOTE: One of the dependencies (fsevents) fails to build its native extension on node.js 12+. + nodejs_version: 10 # Windows build and tests - b_win: *workflow_trigger_on_tags @@ -1216,4 +1141,8 @@ workflows: # Emscripten build and tests that take more than 15 minutes to execute - b_ems: *workflow_trigger_on_tags - - t_ems_test_ext_colony: *workflow_emscripten + - t_ems_test_ext: + <<: *workflow_emscripten + name: t_ems_test_ext_colony + project: colony + gitter_notify: yes