Skip to content

Commit

Permalink
fix(ci): Bring back hack for contracts build till full migration to f…
Browse files Browse the repository at this point in the history
…oundry (#3000)

## What ❔

Creation of empty dirs, to support building from both new
(foundry-built) and old contracts

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor
lint`.
  • Loading branch information
artmakh authored Oct 2, 2024
1 parent eed8198 commit 8c9b332
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ jobs:
if [ $(jq length <<<"$tags") -eq 0 ]; then
echo "No tag found on all pages."
echo "BUILD_CONTRACTS=true" >> "$GITHUB_ENV"
# TODO Remove it when we migrate to foundry inside contracts repository
mkdir -p contracts/l1-contracts/artifacts/
exit 0
fi
filtered_tag=$(jq -r --arg commit_sha "$commit_sha" 'map(select(.commit.sha == $commit_sha)) | .[].name' <<<"$tags")
if [[ ! -z "$filtered_tag" ]]; then
echo "BUILD_CONTRACTS=false" >> "$GITHUB_ENV"
# TODO Remove it when we migrate to foundry inside contracts repository
mkdir -p contracts/l1-contracts/out
break
fi
((page++))
Expand Down
4 changes: 3 additions & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ check-contracts:
fi

# Build and download needed contracts
# TODO Remove mkdir once we use foundry inside contracts repo
prepare-contracts: check-tools check-contracts
@cd ../ && \
export ZKSYNC_HOME=$$(pwd) && \
export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \
zkt || true && \
zk_supervisor contracts
zk_supervisor contracts && \
mkdir -p contracts/l1-contracts/artifacts

# Download setup-key
prepare-keys:
Expand Down
2 changes: 2 additions & 0 deletions docker/external-node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ COPY contracts/system-contracts/contracts-preprocessed/precompiles/artifacts/ /c
COPY contracts/system-contracts/artifacts-zk /contracts/system-contracts/artifacts-zk
COPY contracts/l1-contracts/out/ /contracts/l1-contracts/out/
COPY contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/
# TODO Remove once we use foundry inside contracts repo
COPY contracts/l1-contracts/artifacts/ /contracts/l1-contracts/artifacts/
COPY etc/tokens/ /etc/tokens/
COPY etc/ERC20/ /etc/ERC20/
COPY etc/multivm_bootloaders/ /etc/multivm_bootloaders/
Expand Down
2 changes: 2 additions & 0 deletions docker/server-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ COPY contracts/system-contracts/contracts-preprocessed/precompiles/artifacts/ /c
COPY contracts/system-contracts/artifacts-zk /contracts/system-contracts/artifacts-zk
COPY contracts/l1-contracts/out/ /contracts/l1-contracts/out/
COPY contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/
# TODO Remove once we use foundry inside contracts repo
COPY contracts/l1-contracts/artifacts/ /contracts/l1-contracts/artifacts/
COPY etc/tokens/ /etc/tokens/
COPY etc/ERC20/ /etc/ERC20/
COPY etc/multivm_bootloaders/ /etc/multivm_bootloaders/
Expand Down

0 comments on commit 8c9b332

Please sign in to comment.