Skip to content
Merged
Show file tree
Hide file tree
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
81 changes: 81 additions & 0 deletions .github/workflows/configure-bridges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Configure Bridges

on:
workflow_dispatch:
inputs:
network_type:
description: 'Network type to configure'
required: true
type: choice
options:
- testnets
- mainnets
default: 'testnets'

jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set matrix based on network type
id: set-matrix
run: |
if [ "${{ github.event.inputs.network_type }}" == "testnets" ]; then
MATRIX='[
{
"source_chain": "sepolia",
"target_chain": "arbitrum_sepolia"
},
{
"source_chain": "arbitrum_sepolia",
"target_chain": "sepolia"
}
]'
else
MATRIX='[
{
"source_chain": "ethereum",
"target_chain": "arbitrum"
},
{
"source_chain": "arbitrum",
"target_chain": "ethereum"
}
]'
fi

# Convertir en une ligne pour GitHub Output
echo "matrix=$(echo "$MATRIX" | jq -c .)" >> $GITHUB_OUTPUT

configure-bridges:
needs: setup-matrix
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
fail-fast: false
concurrency:
group: configure-bridges-${{ matrix.source_chain }}-${{ matrix.target_chain }}
cancel-in-progress: true
env:
CI: true
environment: ${{ matrix.source_chain }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
cache: true

- name: Configure bridge from ${{ matrix.source_chain }} to ${{ matrix.target_chain }}
env:
ADMIN_PRIVATE_KEY: ${{ secrets.ADMIN_PRIVATE_KEY }}
SOURCE_CHAIN: ${{ matrix.source_chain }}
TARGET_CHAIN: ${{ matrix.target_chain }}
RPC_URL: ${{ secrets.RPC_URL }}
run: make configure-bridge
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ configure-bridge: # SOURCE_CHAIN, TARGET_CHAIN, RPC_URL
SOURCE_CHAIN=$(SOURCE_CHAIN) TARGET_CHAIN=$(TARGET_CHAIN) \
forge script script/bridges/layerZero/IexecLayerZeroBridge.s.sol:Configure \
--rpc-url $(RPC_URL) \
--account $(ACCOUNT) \
$$(if [ "$(CI)" = "true" ]; then echo "--private-key $(ADMIN_PRIVATE_KEY)"; else echo "--account $(ACCOUNT)"; fi) \
--broadcast \
-vvv

Expand Down