git.delta.rocks / unique-network / refs/commits / 2fd0e86ac3cf

difftreelog

source

.github/workflows/forkless-update-nodata_v2.yml6.2 KiBsourcehistory
123# Controls when the action will run.4on:5  workflow_call:678#Define Workflow variables9env:10  REPO_URL: ${{ github.server_url }}/${{ github.repository }}1112#concurrency:13#  group: ${{ github.workflow }}-${{ github.head_ref }}14#  cancel-in-progress: true1516# A workflow run is made up of one or more jobs that can run sequentially or in parallel17jobs:18  execution-marix:1920    name: Prepare 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      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it32      - uses: actions/checkout@v333        with:34          ref: ${{ github.head_ref }}  #Checking out head commit3536      - name: Read .env file37        uses: xom9ikk/dotenv@v1.0.23839      - name: Create Execution matrix40        uses: fabiocaccamo/create-matrix-action@v241        id: create_matrix42        with:43          matrix: |44            network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}45            network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}46            network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}474849  forkless-update-nodata:50    needs: execution-marix51    # The type of runner that the job will run on52    runs-on: [self-hosted-ci,large]5354    timeout-minutes: 13805556    name: ${{ matrix.network }}5758    continue-on-error: true         #Do not stop testing of matrix runs failed.  As it decided during PR review - it required 50/50& Let's check it with false.5960    strategy:61      matrix:62        include: ${{fromJson(needs.execution-marix.outputs.matrix)}}    6364    steps:65      - name: Clean Workspace66        uses: AutoModality/action-clean@v1.1.06768      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it69      - uses: actions/checkout@v370        with:71          ref: ${{ github.head_ref }}  #Checking out head commit7273      - name: Read .env file74        uses: xom9ikk/dotenv@v1.0.27576      - name: Generate ENV related extend file for docker-compose77        uses: cuchi/jinja2-action@v1.2.078        with:79          template: .docker/docker-compose.tmp-forkless-nodata.j280          output_file: .docker/docker-compose.${{ matrix.network }}.yml81          variables: |82            REPO_URL=${{ github.server_url }}/${{ github.repository }}.git83            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}84            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}85            POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}86            MAINNET_TAG=${{ matrix.mainnet_tag }}87            MAINNET_BRANCH=${{ matrix.mainnet_branch }}88            FEATURE=${{ matrix.features }}89            RUNTIME=${{ matrix.runtime }}90            BRANCH=${{ github.head_ref }}9192      - name: Show build configuration93        run: cat .docker/docker-compose.${{ matrix.network }}.yml9495      - name: Generate launch-config-forkless-nodata.json96        uses: cuchi/jinja2-action@v1.2.097        with:98          template: .docker/forkless-config/launch-config-forkless-nodata.j299          output_file: .docker/launch-config-forkless-nodata.json100          variables: |101            FEATURE=${{ matrix.features }}102            RUNTIME=${{ matrix.runtime }}103104      - name: Show launch-config-forkless configuration105        run: cat .docker/launch-config-forkless-nodata.json106107108      - name: Build the stack109        run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build  --force-recreate --timeout 300110111      - name: Check if docker logs consist logs related to Runtime Upgrade testing.112        if: success()113        run: |114          counter=160115          function check_container_status {116                docker inspect -f {{.State.Running}} node-parachain117          }118          function do_docker_logs {119                docker logs --details node-parachain  2>&1120          }121          function is_started {122                if [ "$(check_container_status)" == "true" ]; then123                        echo "Container: node-parachain RUNNING";124                        echo "Check Docker logs"125                        DOCKER_LOGS=$(do_docker_logs)126                        if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then127                                echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"128                                return 0129                        elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then130                                echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"131                                return 1132                        else133                                echo "Message not found in logs output, repeating..."134                                return 1135                        fi136                else137                        echo "Container node-parachain not RUNNING"138                        echo "Halting all future checks"139                        exit 1140                fi141          exit 0142          }143          while ! is_started; do144                echo "Waiting for special message in log files "145                sleep 30s146                counter=$(( $counter - 1 ))147                echo "Counter: $counter"148                if [ "$counter" -gt "0" ]; then149                         continue150                else151                         break152                fi153          done154          echo "Halting script"155          exit 0156        shell: bash157158      - name: Collect Docker Logs159        if: success() || failure()160        uses: jwalton/gh-docker-logs@v2.2.0161        with:162          dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}'163          images: 'node-parachain'164165      - name: Show docker logs166        if: success() || failure()167        run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log'168169      - name: Stop running containers170        if: always()                   # run this step always171        run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down