1name: Fork Parachain update with data234on:5 6 pull_request:7 branches:8 - master9 types:10 - opened11 - reopened12 - synchronize 13 - ready_for_review1415 16 workflow_dispatch:171819env:20 REPO_URL: ${{ github.server_url }}/${{ github.repository }}212223jobs:2425 prepare-execution-marix-fork:26 27 name: Prepare execution matrix for fork28 29 runs-on: self-hosted-ci30 outputs:31 matrix: ${{ steps.create_matrix.outputs.matrix }}32 steps:33 34 - name: Clean Workspace35 uses: AutoModality/action-clean@v1.1.03637 38 - uses: actions/checkout@v339 with:40 ref: ${{ github.head_ref }} 4142 - name: Read .env file43 uses: xom9ikk/dotenv@v1.0.24445 - name: Create Execution matrix46 uses: fabiocaccamo/create-matrix-action@v247 id: create_matrix48 with:49 matrix: |50 network {Opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws-opal.unique.network:443'}51 network {Quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws-quartz.unique.network:443'}52 network {Unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, fork_from_address {'wss://eu-ws.unique.network:443'}53545556 fork-update-withdata:57 needs: prepare-execution-marix-fork58 59 runs-on: self-hosted-ci6061 name: Build Container, Spin it Up an test6263 continue-on-error: true 6465 strategy:66 matrix:67 include: ${{fromJson(needs.prepare-execution-marix-fork.outputs.matrix)}}6869 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/forking/docker-compose.tmp-fork.j2103 output_file: .docker/forking/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 }}114 FORK_FROM=${{ matrix.fork_from_address }}115116 - name: Show build configuration117 run: cat .docker/forking/docker-compose.${{ matrix.network }}.yml118119 - name: Generate launch-config-fork.json120 uses: cuchi/jinja2-action@v1.2.0121 with:122 template: .docker/forking/launch-config-fork.j2123 output_file: .docker/forking/launch-config-fork.json124 variables: |125 FEATURE=${{ matrix.features }}126 RUNTIME=${{ matrix.runtime }}127128 - name: Show launch-config-fork configuration129 run: cat .docker/forking/launch-config-fork.json130131132 - name: Build the stack133 run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300134135 - name: Check if docker logs consist logs related to Runtime Upgrade testing.136 if: success()137 run: |138 counter=160139 function do_docker_logs {140 docker logs --details parachain-fork 2>&1141 }142 function is_started {143 echo "Check Docker logs"144 DOCKER_LOGS=$(do_docker_logs)145 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then146 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"147 return 0148 exit 0149 fi150 echo "Function is_started: Return 1"151 return 1152 }153 while ! is_started; do154 echo "Waiting for special message in log files "155 sleep 30s156 counter=$(( $counter - 1 ))157 echo "Counter: $counter"158 if [ "$counter" -gt "0" ]; then159 continue160 else161 break162 fi163 done164 exit 1165 shell: bash166167 - name: Collect Docker Logs168 if: success() || failure()169 uses: jwalton/gh-docker-logs@v2.2.0170 with:171 dest: './fork-parachain-update-withdata-logs.${{ matrix.features }}'172 images: 'parachain-fork' 173174 - name: Tar logs175 if: success() || failure()176 run: tar cvzf ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz ./fork-parachain-update-withdata-logs.${{ matrix.features }}177178 - name: Upload logs to GitHub179 if: success() || failure()180 uses: actions/upload-artifact@master181 with:182 name: fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz183 path: ./fork-parachain-update-withdata-logs.${{ matrix.features }}.tgz184185 - name: Stop running containers186 if: always() 187 run: docker-compose -f ".docker/forking/docker-compose-fork.yaml" -f ".docker/forking/docker-compose.${{ matrix.network }}.yml" down