-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add script to recursive update dep
- Loading branch information
1 parent
5565988
commit f6e267f
Showing
9 changed files
with
180 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Create Storage Change Log | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- mainnet | ||
- testnet | ||
- "release/*" | ||
- "feature/*" | ||
- "features/*" | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: [self-hosted, dockerize] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Update package with soldeer | ||
run: forge soldeer update | ||
|
||
- name: Recursively update dependencies | ||
run: | | ||
chmod +x ./update-deps.sh | ||
./update-deps.sh | ||
id: update-deps | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --skip scripts tests | ||
id: build | ||
|
||
- name: "Setup Node" | ||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v3.4.1 | ||
with: | ||
node-version: v16.16.0 | ||
|
||
- name: Storage Layout Check | ||
run: | | ||
echo "Checking storage layout..." | ||
echo "Current branch: ${{ github.head_ref || github.ref_name }}" | ||
echo "BASE_BRANCH: ${{ github.event.pull_request.base.ref }}" | ||
echo "CURRENT_COMMIT_HASH: ${{ github.sha }}" | ||
git fetch --unshallow || git fetch --all | ||
dependencies/@storage-delta-0.3.1/run.sh ${{ github.event.pull_request.base.sha }} --omit new --contracts contracts | ||
- name: Check for storage_delta folder | ||
id: check-folder | ||
run: | | ||
if [ -d "storage_delta" ]; then | ||
echo "storage_delta_exists=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Commit and changes | ||
if: steps.check-folder.outputs.storage_delta_exists == 'true' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add storage_delta | ||
git commit -m "Add contract layout changes [CI]" | ||
git push origin HEAD:${{ github.head_ref || github.ref_name }} | ||
current_commit=$(git rev-parse HEAD) | ||
previous_commit=$(git rev-parse HEAD~1) | ||
# Move HEAD to the previous commit | ||
git reset --soft HEAD~2 | ||
|
||
# Stage the changes in storage_delta | ||
git add storage_delta | ||
|
||
# Amend the previous commit | ||
git commit --amend --no-edit | ||
|
||
# Force push the changes | ||
git push --force origin HEAD:${{ github.head_ref || github.ref_name }} | ||
|
||
# Move HEAD back to the original commit | ||
echo "Prev commit: ${previous_commit}" | ||
echo "Curr commit: ${current_commit}" | ||
git cherry-pick $current_commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- storage_delta//contracts//mocks//MockBridge-OLD 2024-08-22 07:18:44.850507737 +0000 | ||
+++ storage_delta//contracts//mocks//MockBridge-NEW 2024-08-22 07:18:44.850507737 +0000 | ||
@@ -1,4 +1,5 @@ | ||
- 0 bridgeOperatorAddedBlock mapping(address => uint256) | ||
- 1 bridgeOperators address[] | ||
- | ||
- | ||
+🏴 0 _collisionVariable uint256 | ||
+🏴 1 _collisionVariable1 uint256 | ||
+🌱 2 _collisionVariable2 uint256 | ||
+🏳️ 3 bridgeOperatorAddedBlock mapping(address => uint256) | ||
+🏳️ 4 bridgeOperators address[] | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Set the path to the dependencies folder | ||
DEPENDENCIES_FOLDER="./dependencies" | ||
|
||
# Check if the dependencies folder exists | ||
if [ ! -d "$DEPENDENCIES_FOLDER" ]; then | ||
echo "Dependencies folder does not exist: $DEPENDENCIES_FOLDER" | ||
exit 1 | ||
fi | ||
|
||
# Change directory to the dependencies folder | ||
cd "$DEPENDENCIES_FOLDER" || exit 1 | ||
|
||
# Iterate through each subdirectory in the dependencies folder | ||
for dir in */; do | ||
if [ -d "$dir" ]; then | ||
echo "Updating dependencies in: $dir" | ||
cd "$dir" || exit 1 | ||
|
||
# Check if soldeer.lock exists | ||
if [ ! -f "soldeer.lock" ]; then | ||
echo "soldeer.lock does not exist in: $dir" | ||
echo "Skipping update for: $dir" | ||
cd .. | ||
continue | ||
fi | ||
|
||
# Run soldeer update | ||
forge soldeer update | ||
|
||
# Return to the dependencies folder | ||
cd .. | ||
fi | ||
done | ||
|
||
# Return to the original directory | ||
cd .. | ||
|
||
echo "All dependencies updated."% |