Skip to content

Commit

Permalink
Merge branch 'main' into elfedy-gas-params
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter authored Dec 12, 2024
2 parents 43df077 + e899df9 commit 3211a82
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 28 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
run: cargo hack check

zk-cargo-test:
runs-on: ubuntu-22.04
runs-on: ubuntu-22.04-github-hosted-16core

steps:
- name: Checkout code
Expand Down Expand Up @@ -154,3 +154,22 @@ jobs:
run: cp ./install-foundry-zksync ./foundryup-zksync/* /tmp/ && cd /tmp && ./install-foundry-zksync
- name: Verify installation
run: forge --version

check-ci-install-anvil:
name: CI install anvil-zksync
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Install foundry-zksync
run: |
cp ./install-foundry-zksync ./foundryup-zksync/* /tmp/
cd /tmp
./install-foundry-zksync
- name: Verify anvil-zksync installation
run: anvil-zksync --version
60 changes: 33 additions & 27 deletions foundryup-zksync/foundryup-zksync
Original file line number Diff line number Diff line change
Expand Up @@ -179,33 +179,43 @@ EOF
done

# Begin anvil-zksync installation
say "downloading anvil-zksync"

# Supported targets for anvil-zksync
SUPPORTED_TARGETS=(
"x86_64-apple-darwin"
"aarch64-apple-darwin"
"x86_64-unknown-linux-gnu"
"aarch64-unknown-linux-gnu"
)

if [ "$ARCHITECTURE" = "arm64" ]; then
ARCHITECTURE="aarch64"
fi
say "downloading latest anvil-zksync"

uname_str="$(uname)"
case "$uname_str" in
"Linux")
os="unknown-linux-gnu"
# Note: If `lscpu` isn't guaranteed to be available,
# you may want to fallback to `uname -m`
arch=$(lscpu | awk '/Architecture:/{print $2}')
;;
"Darwin")
os="apple-darwin"
arch=$(arch)
;;
*)
err "anvil-zksync only supports Linux and MacOS! Detected OS: $uname_str"
;;
esac

if [ "$PLATFORM" = "darwin" ]; then
TARGET="${ARCHITECTURE}-apple-${PLATFORM}"
elif [ "$PLATFORM" = "linux" ]; then
TARGET="${ARCHITECTURE}-unknown-${PLATFORM}-gnu"
else
TARGET="${ARCHITECTURE}-${PLATFORM}"
fi
# Normalize architecture
case "$arch" in
"x86_64")
architecture="x86_64"
;;
"arm64"|"aarch64")
architecture="aarch64"
;;
*)
err "Unsupported architecture detected!"
;;
esac

TARGET="${architecture}-${os}"

if [[ " ${SUPPORTED_TARGETS[*]} " == *" $TARGET "* ]]; then
if [ "$PLATFORM" = "linux" ] || [ "$PLATFORM" = "darwin" ]; then
ANVIL_REPO="matter-labs/anvil-zksync"

say "getting latest tag for anvil-zksync"

ANVIL_TAG=$(curl -s https://api.github.com/repos/$ANVIL_REPO/releases/latest | sed -n 's/.*"tag_name": "\([^"]*\)".*/\1/p')

if [ -z "$ANVIL_TAG" ]; then
Expand All @@ -218,12 +228,8 @@ EOF

ANVIL_BIN_PATH="$FOUNDRY_BIN_DIR/anvil-zksync"

say "downloading anvil-zksync from $ANVIL_BIN_URL"

ensure download "$ANVIL_BIN_URL" | ensure tar -xzC "$FOUNDRY_BIN_DIR"

mv "$FOUNDRY_BIN_DIR/anvil-zksync" "$ANVIL_BIN_PATH"

chmod +x "$ANVIL_BIN_PATH"

say "installed - $(ensure "$ANVIL_BIN_PATH" --version)"
Expand Down

0 comments on commit 3211a82

Please sign in to comment.