Skip to content

Commit

Permalink
Add caching of docker layers on integration tests job (#1333)
Browse files Browse the repository at this point in the history
* remove docker prune from ops tasks

* add cache for optimism build on integration-tests job
  • Loading branch information
mjlescano authored Jun 16, 2021
1 parent 5b63890 commit 29684b5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ jobs:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- optimism-build
- run:
name: Build docker containers
name: Build docker containers if necessary
command: |
npx hardhat ops --fresh --build --build-ops --optimism-path ./optimism
if [ ! -d ./optimism ]; then
npx hardhat ops --fresh --build --build-ops --optimism-path ./optimism
fi;
- save_cache:
key: optimism-build
paths:
- ./optimism
- run:
name: Start docker chains
background: true
Expand Down
17 changes: 13 additions & 4 deletions .circleci/src/jobs/job-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@ steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- optimism-build
- run:
name: Build docker containers
name: Build docker containers if necessary
command: |
npx hardhat ops --fresh --build --build-ops --optimism-path ./optimism
if [ ! -d ./optimism ]; then
npx hardhat ops --fresh --build --build-ops --optimism-path ./optimism
fi;
- save_cache:
key: optimism-build
paths:
- ./optimism
- run:
name: Start docker chains
background: true
command: |
npx hardhat ops --start --optimism-path ./optimism
- cmd-wait-for-port:
port: 8545
port: 8545
- cmd-wait-for-port:
port: 9545
port: 9545
- run:
name: Run isolated layer 1 integration tests
command: |
Expand Down
2 changes: 0 additions & 2 deletions hardhat/tasks/task-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ function _imagesExist() {
}

function _fresh({ opsPath }) {
console.log(gray(' prune docker'));
execa.sync('docker', ['system', 'prune', '-f']);
console.log(gray(' clone fresh repository into', opsPath));
execa.sync('sh', ['-c', 'rm -drf ' + opsPath]);
execa.sync('sh', [
Expand Down

0 comments on commit 29684b5

Please sign in to comment.