Skip to content

Commit

Permalink
feat: add SKIP_L1_PROPOSAL flag to skip L1 transactions
Browse files Browse the repository at this point in the history
   - Added SKIP_L1_PROPOSAL environment variable with default value false
   - When SKIP_L1_PROPOSAL=true, sets OP_SUCCINCT_SKIP_L1=true
   - Added logging when L1 transactions are skipped
   
   Closes #258
  • Loading branch information
crStiv authored Dec 17, 2024
1 parent f28db3c commit 2adfaa8
Showing 1 changed file with 50 additions and 0 deletions.
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

0 comments on commit 2adfaa8

Please sign in to comment.