1name: Forkless Parachain update with no data234on:5 6 pull_request:7 branches:8 - master9 types:10 - opened11 - reopened12 - synchronize 1314 15 workflow_dispatch:161718env:19 REPO_URL: ${{ github.server_url }}/${{ github.repository }}202122jobs:2324 prepare-execution-marix:25 26 name: Prepare execution matrix27 28 runs-on: self-hosted-ci29 outputs:30 matrix: ${{ steps.create_matrix.outputs.matrix }}31 steps:32 33 - name: Clean Workspace34 uses: AutoModality/action-clean@v1.1.03536 37 - uses: actions/checkout@v338 with:39 ref: ${{ github.head_ref }} 4041 - name: Read .env file42 uses: xom9ikk/dotenv@v1.0.24344 - name: Create Execution matrix45 uses: fabiocaccamo/create-matrix-action@v246 id: create_matrix47 with:48 matrix: |49 network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}50 network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}51 network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}52535455 forkless-update-nodata:56 needs: prepare-execution-marix57 58 runs-on: self-hosted-ci5960 name: ${{ matrix.network }} - Forkless Parachain Upgrade NO data6162 continue-on-error: true 6364 strategy:65 matrix:66 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}676869 steps:70 - name: Skip if pull request is in Draft71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 if: github.event.pull_request.draft == true86 run: exit 18788 - name: Clean Workspace89 uses: AutoModality/action-clean@v1.1.09091 92 - uses: actions/checkout@v393 with:94 ref: ${{ github.head_ref }} 9596 - name: Read .env file97 uses: xom9ikk/dotenv@v1.0.29899 - name: Generate ENV related extend file for docker-compose100 uses: cuchi/jinja2-action@v1.2.0101 with:102 template: .docker/docker-compose.tmp-forkless.j2103 output_file: .docker/docker-compose.${{ matrix.network }}.yml104 variables: |105 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git106 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}107 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}108 POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}109 MAINNET_TAG=${{ matrix.mainnet_tag }}110 MAINNET_BRANCH=${{ matrix.mainnet_branch }}111 FEATURE=${{ matrix.features }}112 RUNTIME=${{ matrix.runtime }}113 BRANCH=${{ github.head_ref }}114115 - name: Show build configuration116 run: cat .docker/docker-compose.${{ matrix.network }}.yml117118 - name: Generate launch-config.json119 uses: cuchi/jinja2-action@v1.2.0120 with:121 template: .docker/launch-config.j2122 output_file: .docker/launch-config-forkless.json123 variables: |124 FEATURE=${{ matrix.features }}125 RUNTIME=${{ matrix.runtime }}126127 - name: Show launch-config-forkless configuration128 run: cat .docker/launch-config-forkless.json129130131 - name: Build the stack132 run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300133134 - name: Check if docker logs consist logs related to Runtime Upgrade testing.135 if: success()136 run: |137 counter=160138 function check_container_status {139 docker inspect -f {{.State.Running}} node-parachain140 }141 function do_docker_logs {142 docker logs --details node-parachain 2>&1143 }144 function is_started {145 if [ "$(check_container_status)" == "true" ]; then146 echo "Container: node-parachain RUNNING";147 echo "Check Docker logs"148 DOCKER_LOGS=$(do_docker_logs)149 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then150 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"151 return 0152 exit 1153 else 154 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."155 return 1156 exit 1157 fi158 else159 echo "Container node-parachain not RUNNING"160 echo "Halting all future checks"161 exit 1162 fi163 exit 0164 }165 while ! is_started; do166 echo "Waiting for special message in log files "167 sleep 30s168 counter=$(( $counter - 1 ))169 echo "Counter: $counter"170 if [ "$counter" -gt "0" ]; then171 continue172 else173 break174 fi175 done176 echo "Halting script"177 exit 0178 shell: bash179180 - name: Collect Docker Logs181 if: success() || failure()182 uses: jwalton/gh-docker-logs@v2.2.0183 with:184 dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}'185 images: 'node-parachain' 186187 - name: Tar logs188 if: success() || failure()189 run: tar cvzf ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-update-nodata-logs.${{ matrix.features }}190191 - name: Upload logs to GitHub192 if: success() || failure()193 uses: actions/upload-artifact@master194 with:195 name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz196 path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz197198 - name: Stop running containers199 if: always() 200 run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down