Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SKIP_L1_PROPOSAL flag to skip L1 transactions #291

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions tools/ci/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
set -euo pipefail

# Add default parameter for skipping L1 transactions
SKIP_L1_PROPOSAL=${SKIP_L1_PROPOSAL:-false}

echo "--- Installing yarn dependencies"

# Disable global cache so that we can cache `.yarn/cache` in buildkite
yarn config set enableGlobalCache false

# Check for lockfile before running yarn --immutable
if [[ -f yarn.lock ]]; then
echo "--- Verifying lockfile integrity"
yarn --immutable || { echo "Lockfile validation failed! Ensure your lockfile is up to date."; exit 1; }
else
echo "Error: yarn.lock file not found. Aborting."
exit 1
fi

# Need to ensure base branch is up-to-date
BASE_BRANCH="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-$BUILDKITE_BRANCH}"
if [[ -z "$BASE_BRANCH" ]]; then
echo "Error: Unable to determine base branch. Ensure BUILDKITE_BRANCH is set."
exit 1
fi

echo "--- Updating local '$BASE_BRANCH' base branch"

# Required for correct Nx affected project resolution
if git fetch -f --no-tags origin "$BASE_BRANCH:$BASE_BRANCH"; then
echo "--- Successfully updated '$BASE_BRANCH'"
else
echo "Error: Failed to fetch base branch '$BASE_BRANCH'. Ensure it exists in the remote repository."
exit 1
fi

# Check SKIP_L1_PROPOSAL flag
if [ "$SKIP_L1_PROPOSAL" = true ]; then
echo "--- Skipping L1 transaction step (SKIP_L1_PROPOSAL=true)"
export OP_SUCCINCT_SKIP_L1=true
fi

echo "--- Building required packages"
if yarn build; then
echo "--- Build completed successfully"
else
echo "Error: Build failed. Check the logs for details."
exit 1
fi
Loading