|
| 1 | +name: Configure Bridges |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + network_type: |
| 7 | + description: 'Network type to configure' |
| 8 | + required: true |
| 9 | + type: choice |
| 10 | + options: |
| 11 | + - testnets |
| 12 | + - mainnets |
| 13 | + default: 'testnets' |
| 14 | + |
| 15 | +jobs: |
| 16 | + setup-matrix: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + outputs: |
| 19 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 20 | + steps: |
| 21 | + - name: Set matrix based on network type |
| 22 | + id: set-matrix |
| 23 | + run: | |
| 24 | + if [ "${{ github.event.inputs.network_type }}" == "testnets" ]; then |
| 25 | + MATRIX='[ |
| 26 | + { |
| 27 | + "source_chain": "sepolia", |
| 28 | + "target_chain": "arbitrum_sepolia" |
| 29 | + }, |
| 30 | + { |
| 31 | + "source_chain": "arbitrum_sepolia", |
| 32 | + "target_chain": "sepolia" |
| 33 | + } |
| 34 | + ]' |
| 35 | + else |
| 36 | + MATRIX='[ |
| 37 | + { |
| 38 | + "source_chain": "ethereum", |
| 39 | + "target_chain": "arbitrum" |
| 40 | + }, |
| 41 | + { |
| 42 | + "source_chain": "arbitrum", |
| 43 | + "target_chain": "ethereum" |
| 44 | + } |
| 45 | + ]' |
| 46 | + fi |
| 47 | + |
| 48 | + # Convertir en une ligne pour GitHub Output |
| 49 | + echo "matrix=$(echo "$MATRIX" | jq -c .)" >> $GITHUB_OUTPUT |
| 50 | +
|
| 51 | + configure-bridges: |
| 52 | + needs: setup-matrix |
| 53 | + runs-on: ubuntu-latest |
| 54 | + strategy: |
| 55 | + matrix: |
| 56 | + include: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} |
| 57 | + fail-fast: false |
| 58 | + concurrency: |
| 59 | + group: configure-bridges-${{ matrix.source_chain }}-${{ matrix.target_chain }} |
| 60 | + cancel-in-progress: true |
| 61 | + env: |
| 62 | + CI: true |
| 63 | + environment: ${{ matrix.source_chain }} |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + - name: Install Foundry |
| 70 | + uses: foundry-rs/foundry-toolchain@v1 |
| 71 | + with: |
| 72 | + version: stable |
| 73 | + cache: true |
| 74 | + |
| 75 | + - name: Configure bridge from ${{ matrix.source_chain }} to ${{ matrix.target_chain }} |
| 76 | + env: |
| 77 | + ADMIN_PRIVATE_KEY: ${{ secrets.ADMIN_PRIVATE_KEY }} |
| 78 | + SOURCE_CHAIN: ${{ matrix.source_chain }} |
| 79 | + TARGET_CHAIN: ${{ matrix.target_chain }} |
| 80 | + RPC_URL: ${{ secrets.RPC_URL }} |
| 81 | + run: make configure-bridge |
0 commit comments