git.delta.rocks / unique-network / refs/commits / 3cd4026bbce3

difftreelog

merge files for workflow xcm in one

Konstantin Astakhov2022-09-15parent: #464a23e.patch.diff
in: master

3 files changed

deleted.github/workflows/xcm-testnet-build.ymldiffbeforeafterboth
before Β· .github/workflows/xcm-testnet-build.yml
1name: xcm-testnet-build23# Controls when the action will run.4on:5  workflow_call:6  7  # Allows you to run this workflow manually from the Actions tab8  workflow_dispatch:910#Define Workflow variables11env:12  REPO_URL: ${{ github.server_url }}/${{ github.repository }}1314# A workflow run is made up of one or more jobs that can run sequentially or in parallel15jobs:1617  prepare-execution-marix:1819    name: Prepare execution matrix2021    runs-on: [XL]22    outputs:23      matrix: ${{ steps.create_matrix.outputs.matrix }}2425    steps:2627      - name: Clean Workspace28        uses: AutoModality/action-clean@v1.1.02930      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it31      - uses: actions/checkout@v332        with:33          ref: ${{ github.head_ref }}  #Checking out head commit3435      - name: Read .env file36        uses: xom9ikk/dotenv@v1.0.23738      - name: Create Execution matrix39        uses: fabiocaccamo/create-matrix-action@v240        id: create_matrix41        with:42          matrix: |43            network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}44            network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}45            network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}4647  xcm-build:48    49    needs: prepare-execution-marix50    # The type of runner that the job will run on51    runs-on: [XL]5253    timeout-minutes: 6005455    name: ${{ matrix.network }}5657    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.5859    strategy:60      matrix:61        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}6263    steps:64      - name: Skip if pull request is in Draft65        if: github.event.pull_request.draft == true66        run: exit 16768      - name: Clean Workspace69        uses: AutoModality/action-clean@v1.1.07071      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it72      - uses: actions/checkout@v373        with:74          ref: ${{ github.head_ref }}  #Checking out head commit7576      - name: Read .env file77        uses: xom9ikk/dotenv@v1.0.27879      - name: Log in to Docker Hub80        uses: docker/login-action@v2.0.081        with:82          username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}83          password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}8485      - name: Install jq86        run: sudo apt install jq -y8788      # - name: Get autorization token from DOCKERHUB89      #   run: |                 90      #     # aquire token91      #       TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)92      #       export TOKEN=$TOKEN9394      # Check POLKADOT version and build it if it doesn't exist in repository95      - name: Generate ENV related extend Dockerfile file for POLKADOT96        uses: cuchi/jinja2-action@v1.2.097        with:98          template: .docker/Dockerfile-polkadot.j299          output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml100          variables: |101            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}102            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}103104      - name: Check if the dockerhub repository contains the needed version POLKADOT105        run: |106          # aquire token107            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)108            export TOKEN=$TOKEN109110          # Get TAGS from DOCKERHUB POLKADOT repository111            POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')112          # Show TAGS113            echo "POLKADOT TAGS:"114            echo $POLKADOT_TAGS115          # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS116            if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then117                echo "Repository has needed POLKADOT version";118                docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}119            else120                echo "Repository has not needed POLKADOT version, so build it";121                cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} .122                echo "Push needed POLKADOT version to the repository";123                docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}124            fi125        shell: bash126127      # Check ACALA version and build it if it doesn't exist in repository128      - name: Generate ENV related extend Dockerfile file for ACALA129        uses: cuchi/jinja2-action@v1.2.0130        with:131          template: .docker/Dockerfile-acala.j2132          output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml133          variables: |134            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}135            ACALA_BUILD_BRANCH=${{ matrix.acala_version }}136137      - name: Check if the dockerhub repository contains the needed ACALA version138        run: |139          # aquire token140            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)141            export TOKEN=$TOKEN142143          # Get TAGS from DOCKERHUB repository144            ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')145          # Show TAGS146            echo "ACALA TAGS:"147            echo $ACALA_TAGS148          # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS149            if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then150                echo "Repository has needed ACALA version";151                docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}152            else153                echo "Repository has not needed ACALA version, so build it";154                cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .155                echo "Push needed ACALA version to the repository";156                docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}157            fi158        shell: bash159160      # Check MOONBEAM version and build it if it doesn't exist in repository161      - name: Generate ENV related extend Dockerfile file for MOONBEAM162        uses: cuchi/jinja2-action@v1.2.0163        with:164          template: .docker/Dockerfile-moonbeam.j2165          output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml166          variables: |167            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}168            MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}169170      - name: Check if the dockerhub repository contains the needed MOONBEAM version171        run: |172          # aquire token173            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)174            export TOKEN=$TOKEN175176          # Get TAGS from DOCKERHUB repository177            MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]')178          # Show TAGS179            echo "MOONBEAM TAGS:"180            echo $MOONBEAM_TAGS181          # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS182            if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then183                echo "Repository has needed MOONBEAM version";184                docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}185            else186                echo "Repository has not needed MOONBEAM version, so build it";187                cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .188                echo "Push needed MOONBEAM version to the repository";189                docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}190            fi191        shell: bash192193194      # Check CUMULUS version and build it if it doesn't exist in repository195      - name: Generate ENV related extend Dockerfile file for CUMULUS196        uses: cuchi/jinja2-action@v1.2.0197        with:198          template: .docker/Dockerfile-cumulus.j2199          output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml200          variables: |201            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}202            CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}203204      - name: Check if the dockerhub repository contains the needed CUMULUS version205        run: |                 206          # aquire token207            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)208            export TOKEN=$TOKEN209210          # Get TAGS from DOCKERHUB repository211            CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]')212          # Show TAGS213            echo "CUMULUS TAGS:"214            echo $CUMULUS_TAGS215          # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS216            if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then217                echo "Repository has needed CUMULUS version";218                docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}219            else220                echo "Repository has not needed CUMULUS version, so build it";221                cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .222                echo "Push needed CUMULUS version to the repository";223                docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}224            fi225        shell: bash226227228      # Build main image for XCM   229      - name: Generate ENV related extend Dockerfile file230        uses: cuchi/jinja2-action@v1.2.0231        with:232          template: .docker/Dockerfile-xcm.j2233          output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml234          variables: |235            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}236            NETWORK=${{ matrix.network }}237            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}238            POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}239            FEATURE=${{ matrix.features }}240            RUNTIME=${{ matrix.runtime }}241            BRANCH=${{ github.head_ref }}242            ACALA_BUILD_BRANCH=${{ matrix.acala_version }}243            MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}244            CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}245246      - name: Show build Dockerfile247        run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml248249      - name: Show launch-config-xcm-${{ matrix.network }} configuration250        run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json251252      - name: Run find-and-replace to remove slashes from branch name253        uses: mad9000/actions-find-and-replace-string@2254        id: branchname255        with:256          source: ${{ github.head_ref }}257          find: '/'258          replace: '-'259260      - name: Pull chainql docker image261        run: docker pull uniquenetwork/builder-chainql:latest262263      - name: Build the stack264        run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .265266      - name: Push docker image version267        run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}268269      - name: Push docker image latest270        run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest271272      - name: Clean Workspace273        if: always()274        uses: AutoModality/action-clean@v1.1.0275276      - name: Remove builder cache277        if: always()                   # run this step always278        run: |279          docker builder prune -f280          docker system prune -f281
deleted.github/workflows/xcm-tests_v2.ymldiffbeforeafterboth
--- a/.github/workflows/xcm-tests_v2.yml
+++ /dev/null
@@ -1,176 +0,0 @@
-name: xcm-tests
-
-# Controls when the action will run.
-on:
-  # Allows you to run this workflow manually from the Actions tab
-  workflow_call:
-
-#Define Workflow variables
-env:
-  REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
-  prepare-execution-marix:
-
-    name: Prepare execution matrix
-
-    #needs: [xcm-testnet-build]
-
-    runs-on: XL
-    outputs:
-      matrix: ${{ steps.create_matrix.outputs.matrix }}
-
-    steps:
-
-      - name: Clean Workspace
-        uses: AutoModality/action-clean@v1.1.0
-
-      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
-      - uses: actions/checkout@v3
-        with:
-          ref: ${{ github.head_ref }}  #Checking out head commit
-
-      - name: Read .env file
-        uses: xom9ikk/dotenv@v1.0.2
-
-      - name: Create Execution matrix
-        uses: fabiocaccamo/create-matrix-action@v2
-        id: create_matrix
-        with:
-          matrix: |
-            network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}
-            network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}
-            network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}
-
-  xcm-tests:
-    needs: prepare-execution-marix
-    # The type of runner that the job will run on
-    runs-on: [XL]
-
-    timeout-minutes: 600
-
-    name: ${{ matrix.network }}
-
-    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.
-
-    strategy:
-      matrix:
-        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
-    steps:
-      - name: Skip if pull request is in Draft
-        if: github.event.pull_request.draft == true
-        run: exit 1
-
-      - name: Clean Workspace
-        uses: AutoModality/action-clean@v1.1.0
-
-      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
-      - uses: actions/checkout@v3
-        with:
-          ref: ${{ github.head_ref }}  #Checking out head commit
-
-      - name: Read .env file
-        uses: xom9ikk/dotenv@v1.0.2
-
-      - name: Generate ENV related extend file for docker-compose
-        uses: cuchi/jinja2-action@v1.2.0
-        with:
-          template: .docker/docker-compose.tmp-xcm-tests.j2
-          output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
-          variables: |
-            NETWORK=${{ matrix.network }}
-
-      - name: Show build configuration
-        run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
-
-      - uses: actions/setup-node@v3
-        with:
-          node-version: 16
-
-      - name: Build the stack
-        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
-
-      #  πŸš€ POLKADOT LAUNCH COMPLETE πŸš€
-      - name: Check if docker logs consist messages related to testing of xcm tests 
-        if: success()
-        run: |
-          counter=160
-          function check_container_status {
-                docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
-          }
-          function do_docker_logs {
-                docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
-          }
-          function is_started {
-                if [ "$(check_container_status)" == "true" ]; then
-                        echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";
-                        echo "Check Docker logs"
-                        DOCKER_LOGS=$(do_docker_logs)
-                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
-                                echo "πŸš€ POLKADOT LAUNCH COMPLETE πŸš€"
-                                return 0
-                        else
-                                echo "Message not found in logs output, repeating..."
-                                return 1
-                        fi
-                else
-                        echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"
-                        echo "Halting all future checks"
-                        exit 1
-                fi
-          echo "something goes wrong"
-          exit 1
-          }
-          while ! is_started; do
-                echo "Waiting for special message in log files "
-                sleep 30s
-                counter=$(( $counter - 1 ))
-                echo "Counter: $counter"
-                if [ "$counter" -gt "0" ]; then
-                         continue
-                else
-                         break
-                fi
-          done
-          echo "Halting script"
-          exit 0
-        shell: bash
-
-      - name: Run XCM tests 
-        working-directory: tests
-        run: |
-          yarn install
-          yarn add mochawesome
-          node scripts/readyness.js
-          echo "Ready to start tests"
-          NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
-
-      - name: XCM Test Report
-        uses: phoenix-actions/test-reporting@v8
-        id: test-report
-        if: success() || failure()    # run this step even if previous step failed
-        with:
-          name: XCM Tests ${{ matrix.network }}            # Name of the check run which will be created
-          path: tests/mochawesome-report/test-*.json    # Path to test results
-          reporter: mochawesome-json
-          fail-on-error: 'false'
-
-      - name: Stop running containers
-        if: always()                   # run this step always
-        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down
-
-      - name: Clean Workspace
-        if: always()
-        uses: AutoModality/action-clean@v1.1.0
-
-      - name: Remove builder cache
-        if: always()                   # run this step always
-        run: |
-          docker system prune -a -f
-
-
-
modified.github/workflows/xcm.ymldiffbeforeafterboth
--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -1,19 +1,397 @@
-name: Nesting XCM
+name: xcm-testnet-build
 
+# Controls when the action will run.
 on:
   workflow_call:
+  
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
 
+#Define Workflow variables
+env:
+  REPO_URL: ${{ github.server_url }}/${{ github.repository }}
 
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
 
-  xcm-testnet-build:
-    name: testnet build
-    uses: ./.github/workflows/xcm-testnet-build.yml
-    secrets: inherit
+  prepare-execution-marix:
+
+    name: Prepare execution matrix
+
+    runs-on: [XL]
+    outputs:
+      matrix: ${{ steps.create_matrix.outputs.matrix }}
+
+    steps:
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v1.0.2
+
+      - name: Create Execution matrix
+        uses: fabiocaccamo/create-matrix-action@v2
+        id: create_matrix
+        with:
+          matrix: |
+            network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, runtest {testXcmOpal}
+            network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, runtest {testXcmQuartz}
+            network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, runtest {testXcmUnique}
+
+  xcm-build:
+    
+    needs: prepare-execution-marix
+    # The type of runner that the job will run on
+    runs-on: [XL]
+
+    timeout-minutes: 600
+
+    name: ${{ matrix.network }}
+
+    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.
+
+    strategy:
+      matrix:
+        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+
+    steps:
+      - name: Skip if pull request is in Draft
+        if: github.event.pull_request.draft == true
+        run: exit 1
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v1.0.2
+
+      - name: Log in to Docker Hub
+        uses: docker/login-action@v2.0.0
+        with:
+          username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+          password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+
+      - name: Install jq
+        run: sudo apt install jq -y
+
+      # Check POLKADOT version and build it if it doesn't exist in repository
+      - name: Generate ENV related extend Dockerfile file for POLKADOT
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/Dockerfile-polkadot.j2
+          output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+
+      - name: Check if the dockerhub repository contains the needed version POLKADOT
+        run: |
+          # aquire token
+            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+            export TOKEN=$TOKEN
+
+          # Get TAGS from DOCKERHUB POLKADOT repository
+            POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
+          # Show TAGS
+            echo "POLKADOT TAGS:"
+            echo $POLKADOT_TAGS
+          # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
+            if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then
+                echo "Repository has needed POLKADOT version";
+                docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+            else
+                echo "Repository has not needed POLKADOT version, so build it";
+                cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} .
+                echo "Push needed POLKADOT version to the repository";
+                docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+            fi
+        shell: bash
+
+      # Check ACALA version and build it if it doesn't exist in repository
+      - name: Generate ENV related extend Dockerfile file for ACALA
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/Dockerfile-acala.j2
+          output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+
+      - name: Check if the dockerhub repository contains the needed ACALA version
+        run: |
+          # aquire token
+            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+            export TOKEN=$TOKEN
+
+          # Get TAGS from DOCKERHUB repository
+            ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
+          # Show TAGS
+            echo "ACALA TAGS:"
+            echo $ACALA_TAGS
+          # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
+            if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
+                echo "Repository has needed ACALA version";
+                docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
+            else
+                echo "Repository has not needed ACALA version, so build it";
+                cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
+                echo "Push needed ACALA version to the repository";
+                docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
+            fi
+        shell: bash
+
+      # Check MOONBEAM version and build it if it doesn't exist in repository
+      - name: Generate ENV related extend Dockerfile file for MOONBEAM
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/Dockerfile-moonbeam.j2
+          output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+
+      - name: Check if the dockerhub repository contains the needed MOONBEAM version
+        run: |
+          # aquire token
+            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+            export TOKEN=$TOKEN
+
+          # Get TAGS from DOCKERHUB repository
+            MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]')
+          # Show TAGS
+            echo "MOONBEAM TAGS:"
+            echo $MOONBEAM_TAGS
+          # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS
+            if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then
+                echo "Repository has needed MOONBEAM version";
+                docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+            else
+                echo "Repository has not needed MOONBEAM version, so build it";
+                cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .
+                echo "Push needed MOONBEAM version to the repository";
+                docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+            fi
+        shell: bash
+
+
+      # Check CUMULUS version and build it if it doesn't exist in repository
+      - name: Generate ENV related extend Dockerfile file for CUMULUS
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/Dockerfile-cumulus.j2
+          output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+      - name: Check if the dockerhub repository contains the needed CUMULUS version
+        run: |                 
+          # aquire token
+            TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+            export TOKEN=$TOKEN
+
+          # Get TAGS from DOCKERHUB repository
+            CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]')
+          # Show TAGS
+            echo "CUMULUS TAGS:"
+            echo $CUMULUS_TAGS
+          # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS
+            if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then
+                echo "Repository has needed CUMULUS version";
+                docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+            else
+                echo "Repository has not needed CUMULUS version, so build it";
+                cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .
+                echo "Push needed CUMULUS version to the repository";
+                docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+            fi
+        shell: bash
+
+
+      # Build main image for XCM   
+      - name: Generate ENV related extend Dockerfile file
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/Dockerfile-xcm.j2
+          output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            NETWORK=${{ matrix.network }}
+            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+            POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
+            FEATURE=${{ matrix.features }}
+            RUNTIME=${{ matrix.runtime }}
+            BRANCH=${{ github.head_ref }}
+            ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+            MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+            CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+      - name: Show build Dockerfile
+        run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+
+      - name: Show launch-config-xcm-${{ matrix.network }} configuration
+        run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
 
+      - name: Run find-and-replace to remove slashes from branch name
+        uses: mad9000/actions-find-and-replace-string@2
+        id: branchname
+        with:
+          source: ${{ github.head_ref }}
+          find: '/'
+          replace: '-'
+
+      - name: Pull chainql docker image
+        run: docker pull uniquenetwork/builder-chainql:latest
+
+      - name: Build the stack
+        run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .
+
+      - name: Push docker image version
+        run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
+
+      - name: Push docker image latest
+        run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
+
+      - name: Remove builder cache
+        if: always()                   # run this step always
+        run: |
+          docker builder prune -f
+          docker system prune -f
+
   xcm-tests:
-    name: tests
-    needs: [ xcm-testnet-build ]
-    uses: ./.github/workflows/xcm-tests_v2.yml
+    needs: xcm-build
+    # The type of runner that the job will run on
+    runs-on: [XL]
+
+    timeout-minutes: 600
+
+    name: ${{ matrix.network }}
+
+    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.
+
+    strategy:
+      matrix:
+        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
 
+    steps:
+      - name: Skip if pull request is in Draft
+        if: github.event.pull_request.draft == true
+        run: exit 1
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
 
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v1.0.2
+
+      - name: Generate ENV related extend file for docker-compose
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/docker-compose.tmp-xcm-tests.j2
+          output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+          variables: |
+            NETWORK=${{ matrix.network }}
+
+      - name: Show build configuration
+        run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+
+      - uses: actions/setup-node@v3
+        with:
+          node-version: 16
+
+      - name: Build the stack
+        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
+
+      #  πŸš€ POLKADOT LAUNCH COMPLETE πŸš€
+      - name: Check if docker logs consist messages related to testing of xcm tests 
+        if: success()
+        run: |
+          counter=160
+          function check_container_status {
+                docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
+          }
+          function do_docker_logs {
+                docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
+          }
+          function is_started {
+                if [ "$(check_container_status)" == "true" ]; then
+                        echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";
+                        echo "Check Docker logs"
+                        DOCKER_LOGS=$(do_docker_logs)
+                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
+                                echo "πŸš€ POLKADOT LAUNCH COMPLETE πŸš€"
+                                return 0
+                        else
+                                echo "Message not found in logs output, repeating..."
+                                return 1
+                        fi
+                else
+                        echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"
+                        echo "Halting all future checks"
+                        exit 1
+                fi
+          echo "something goes wrong"
+          exit 1
+          }
+          while ! is_started; do
+                echo "Waiting for special message in log files "
+                sleep 30s
+                counter=$(( $counter - 1 ))
+                echo "Counter: $counter"
+                if [ "$counter" -gt "0" ]; then
+                         continue
+                else
+                         break
+                fi
+          done
+          echo "Halting script"
+          exit 0
+        shell: bash
+
+      - name: Run XCM tests 
+        working-directory: tests
+        run: |
+          yarn install
+          yarn add mochawesome
+          node scripts/readyness.js
+          echo "Ready to start tests"
+          NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
+
+      - name: XCM Test Report
+        uses: phoenix-actions/test-reporting@v8
+        id: test-report
+        if: success() || failure()    # run this step even if previous step failed
+        with:
+          name: XCM Tests ${{ matrix.network }}            # Name of the check run which will be created
+          path: tests/mochawesome-report/test-*.json    # Path to test results
+          reporter: mochawesome-json
+          fail-on-error: 'false'
+
+      - name: Stop running containers
+        if: always()                   # run this step always
+        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down
+
+      - name: Clean Workspace
+        if: always()
+        uses: AutoModality/action-clean@v1.1.0
+
+      - name: Remove builder cache
+        if: always()                   # run this step always
+        run: |
+          docker system prune -a -f