1name: Forkless Parachain update with no data234on:5 6 pull_request:7 branches:8 - develop9 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: Build Container, Spin it Up an test6162 continue-on-error: true 6364 strategy:65 matrix:66 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}676869 steps:7071 72 73 74 75 76 77 78 79 80 81 82 83 84 85868788 - 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 fi154 else155 echo "Container node-parachain not RUNNING"156 echo "Halting all future checks"157 exit 1158 fi159 exit 0160 }161 while ! is_started; do162 echo "Waiting for special message in log files "163 sleep 30s164 counter=$(( $counter - 1 ))165 echo "Counter: $counter"166 if [ "$counter" -gt "0" ]; then167 continue168 else169 break170 fi171 done172 echo "Halting script"173 exit 1174 shell: bash175176 - name: Collect Docker Logs177 if: success() || failure()178 uses: jwalton/gh-docker-logs@v2.2.0179 with:180 dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}'181 images: 'node-parachain' 182183 - name: Tar logs184 if: success() || failure()185 run: tar cvzf ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-update-nodata-logs.${{ matrix.features }}186187 - name: Upload logs to GitHub188 if: success() || failure()189 uses: actions/upload-artifact@master190 with:191 name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz192 path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz193194195196