12on:3 workflow_call:4567env:8 REPO_URL: ${{ github.server_url }}/${{ github.repository }}910111213141516jobs:1718 execution-marix:1920 name: execution matrix2122 runs-on: self-hosted-ci23 outputs:24 matrix: ${{ steps.create_matrix.outputs.matrix }}2526 steps:2728 - name: Clean Workspace29 uses: AutoModality/action-clean@v1.1.03031 32 - uses: actions/checkout@v333 with:34 ref: ${{ github.head_ref }} 3536 - name: Read .env file37 uses: xom9ikk/dotenv@v1.0.23839 - name: Create Execution matrix40 uses: CertainLach/create-matrix-action@v341 id: create_matrix42 with:43 matrix: |44 network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}45 network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}46 network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}4748 forkless-update-data:49 needs: execution-marix50 51 runs-on: [self-hosted-ci,large]52 timeout-minutes: 138053 54 name: ${{ matrix.network }}55 strategy:56 matrix:57 include: ${{fromJson(needs.execution-marix.outputs.matrix)}}5859 continue-on-error: true 606162 steps:63 - name: Clean Workspace64 uses: AutoModality/action-clean@v1.1.06566 67 - uses: actions/checkout@v368 with:69 ref: ${{ github.head_ref }} 7071 - name: Read .env file72 uses: xom9ikk/dotenv@v1.0.27374 - name: Generate ENV related extend file for docker-compose75 uses: cuchi/jinja2-action@v1.2.076 with:77 template: .docker/docker-compose.tmp-forkless-data.j278 output_file: .docker/docker-compose.${{ matrix.network }}.yml79 variables: |80 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git81 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}82 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}83 POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}84 MAINNET_TAG=${{ matrix.mainnet_tag }}85 MAINNET_BRANCH=${{ matrix.mainnet_branch }}86 FEATURE=${{ matrix.features }}87 RUNTIME=${{ matrix.runtime }}88 BRANCH=${{ github.head_ref }}89 REPLICA_FROM=${{ matrix.replica_from_address }}9091 - name: Show build configuration92 run: cat .docker/docker-compose.${{ matrix.network }}.yml9394 - name: Generate launch-config-forkless-data.json95 uses: cuchi/jinja2-action@v1.2.096 with:97 template: .docker/forkless-config/launch-config-forkless-data.j298 output_file: .docker/launch-config-forkless-data.json99 variables: |100 FEATURE=${{ matrix.features }}101 RUNTIME=${{ matrix.runtime }}102103 - name: Show launch-config-forkless configuration104 run: cat .docker/launch-config-forkless-data.json105106107 - name: Build the stack108 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300109110 - name: Check if docker logs consist logs related to Runtime Upgrade testing.111 if: success()112 run: |113 counter=160114 function check_container_status {115 docker inspect -f {{.State.Running}} node-parachain116 }117 function do_docker_logs {118 docker logs --details node-parachain 2>&1119 }120 function is_started {121 if [ "$(check_container_status)" == "true" ]; then122 echo "Container: node-parachain RUNNING";123 echo "Check Docker logs"124 DOCKER_LOGS=$(do_docker_logs)125 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then126 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"127 return 0128 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then129 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"130 return 1131 else132 echo "Message not found in logs output, repeating..."133 return 1134 fi135 else136 echo "Container node-parachain not RUNNING"137 echo "Halting all future checks"138 exit 1139 fi140 exit 0141 }142 while ! is_started; do143 echo "Waiting for special message in log files "144 sleep 30s145 counter=$(( $counter - 1 ))146 echo "Counter: $counter"147 if [ "$counter" -gt "0" ]; then148 continue149 else150 break151 fi152 done153 echo "Halting script"154 exit 0155 shell: bash156157 - name: Collect Docker Logs158 if: success() || failure()159 uses: jwalton/gh-docker-logs@v2.2.0160 with:161 dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}'162 images: 'node-parachain'163164 - name: Show Docker logs165 if: success() || failure()166 run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log'167168 - name: Stop running containers169 if: always() 170 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down --volumes