Skip to content

Commit

Permalink
Merge branch 'release' into testnode-CI-simple
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi authored Oct 29, 2024
2 parents df50256 + 3086f24 commit 1882092
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
restore-keys: ${{ runner.os }}-buildx-

- name: Startup Nitro testnode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Start the test node and get PID, to terminate it once send-l2 is done.
cd ${GITHUB_WORKSPACE}

./test-node.bash "$@"
./test-node.bash "$@" --ci

if [ $? -ne 0 ]; then
echo "test-node.bash failed"
Expand Down
37 changes: 37 additions & 0 deletions docker-compose-ci-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"target": {
"scripts": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
},
"rollupcreator": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
},
"tokenbridge": {
"cache-from": [
"type=local,src=/tmp/.buildx-cache"
],
"cache-to": [
"type=local,dest=/tmp/.buildx-cache,mode=max"
],
"output": [
"type=docker"
]
}
}
}
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- "127.0.0.1:6379:6379"

geth:
image: ethereum/client-go:latest
image: ethereum/client-go:stable
ports:
- "127.0.0.1:8545:8545"
- "127.0.0.1:8551:8551"
Expand Down
19 changes: 15 additions & 4 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ else
fi

run=true
ci=false
validate=false
detach=false
blockscout=false
Expand Down Expand Up @@ -107,6 +108,10 @@ while [[ $# -gt 0 ]]; do
done
fi
;;
--ci)
ci=true
shift
;;
--build)
build_dev_nitro=true
build_dev_blockscout=true
Expand Down Expand Up @@ -342,11 +347,17 @@ if $build_utils; then
if $tokenbridge || $l3_token_bridge; then
LOCAL_BUILD_NODES="$LOCAL_BUILD_NODES tokenbridge"
fi
UTILS_NOCACHE=""
if $force_build_utils; then

if [ "$ci" == true ]; then
# workaround to cache docker layers and keep using docker-compose in CI
docker buildx bake --file docker-compose.yaml --file docker-compose-ci-cache.json $LOCAL_BUILD_NODES
else
UTILS_NOCACHE=""
if $force_build_utils; then
UTILS_NOCACHE="--no-cache"
fi
docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES
fi
docker compose build --no-rm $UTILS_NOCACHE $LOCAL_BUILD_NODES
fi

if $dev_nitro; then
Expand All @@ -366,7 +377,7 @@ if $blockscout; then
fi

if $build_node_images; then
docker compose build --no-rm $NODES scripts
docker compose build --no-rm $NODES
fi

if $force_init; then
Expand Down

0 comments on commit 1882092

Please sign in to comment.