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
--- a/.github/workflows/xcm-testnet-build.yml
+++ /dev/null
@@ -1,281 +0,0 @@
-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:
-
-  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 }}}
-            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 }}}
-            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 }}}
-
-  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
-
-      # - name: Get autorization token from DOCKERHUB
-      #   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
-
-      # 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: Clean Workspace
-        if: always()
-        uses: AutoModality/action-clean@v1.1.0
-
-      - name: Remove builder cache
-        if: always()                   # run this step always
-        run: |
-          docker builder prune -f
-          docker system prune -f
-
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
1name: Nesting XCM1name: xcm-testnet-build
22
3# Controls when the action will run.
3on:4on:
4 workflow_call:5 workflow_call:
56
67 # Allows you to run this workflow manually from the Actions tab
8 workflow_dispatch:
9
10#Define Workflow variables
11env:
12 REPO_URL: ${{ github.server_url }}/${{ github.repository }}
13
14# A workflow run is made up of one or more jobs that can run sequentially or in parallel
7jobs:15jobs:
16
17 prepare-execution-marix:
18
19 name: Prepare execution matrix
20
21 runs-on: [XL]
22 outputs:
23 matrix: ${{ steps.create_matrix.outputs.matrix }}
24
25 steps:
26
27 - name: Clean Workspace
28 uses: AutoModality/action-clean@v1.1.0
29
30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31 - uses: actions/checkout@v3
32 with:
33 ref: ${{ github.head_ref }} #Checking out head commit
34
35 - name: Read .env file
36 uses: xom9ikk/dotenv@v1.0.2
37
38 - name: Create Execution matrix
39 uses: fabiocaccamo/create-matrix-action@v2
40 id: create_matrix
41 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 }}}, runtest {testXcmOpal}
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 }}}, runtest {testXcmQuartz}
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 }}}, runtest {testXcmUnique}
846
9 xcm-testnet-build:47 xcm-build:
48
49 needs: prepare-execution-marix
50 # The type of runner that the job will run on
51 runs-on: [XL]
52
53 timeout-minutes: 600
54
10 name: testnet build55 name: ${{ matrix.network }}
56
57 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.
58
59 strategy:
60 matrix:
61 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
62
63 steps:
64 - name: Skip if pull request is in Draft
65 if: github.event.pull_request.draft == true
66 run: exit 1
67
68 - name: Clean Workspace
11 uses: ./.github/workflows/xcm-testnet-build.yml69 uses: AutoModality/action-clean@v1.1.0
70
71 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
12 secrets: inherit72 - uses: actions/checkout@v3
73 with:
74 ref: ${{ github.head_ref }} #Checking out head commit
75
76 - name: Read .env file
77 uses: xom9ikk/dotenv@v1.0.2
78
79 - name: Log in to Docker Hub
80 uses: docker/login-action@v2.0.0
81 with:
82 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
83 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
84
85 - name: Install jq
86 run: sudo apt install jq -y
87
88 # Check POLKADOT version and build it if it doesn't exist in repository
89 - name: Generate ENV related extend Dockerfile file for POLKADOT
90 uses: cuchi/jinja2-action@v1.2.0
91 with:
92 template: .docker/Dockerfile-polkadot.j2
93 output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml
94 variables: |
95 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
96 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
97
98 - name: Check if the dockerhub repository contains the needed version POLKADOT
99 run: |
100 # aquire token
101 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)
102 export TOKEN=$TOKEN
103
104 # Get TAGS from DOCKERHUB POLKADOT repository
105 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"]')
106 # Show TAGS
107 echo "POLKADOT TAGS:"
108 echo $POLKADOT_TAGS
109 # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
110 if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then
111 echo "Repository has needed POLKADOT version";
112 docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
113 else
114 echo "Repository has not needed POLKADOT version, so build it";
115 cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} .
116 echo "Push needed POLKADOT version to the repository";
117 docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
118 fi
119 shell: bash
120
121 # Check ACALA version and build it if it doesn't exist in repository
122 - name: Generate ENV related extend Dockerfile file for ACALA
123 uses: cuchi/jinja2-action@v1.2.0
124 with:
125 template: .docker/Dockerfile-acala.j2
126 output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
127 variables: |
128 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
129 ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
130
131 - name: Check if the dockerhub repository contains the needed ACALA version
132 run: |
133 # aquire token
134 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)
135 export TOKEN=$TOKEN
136
137 # Get TAGS from DOCKERHUB repository
138 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"]')
139 # Show TAGS
140 echo "ACALA TAGS:"
141 echo $ACALA_TAGS
142 # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
143 if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
144 echo "Repository has needed ACALA version";
145 docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
146 else
147 echo "Repository has not needed ACALA version, so build it";
148 cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
149 echo "Push needed ACALA version to the repository";
150 docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
151 fi
152 shell: bash
153
154 # Check MOONBEAM version and build it if it doesn't exist in repository
155 - name: Generate ENV related extend Dockerfile file for MOONBEAM
156 uses: cuchi/jinja2-action@v1.2.0
157 with:
158 template: .docker/Dockerfile-moonbeam.j2
159 output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml
160 variables: |
161 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
162 MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
163
164 - name: Check if the dockerhub repository contains the needed MOONBEAM version
165 run: |
166 # aquire token
167 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)
168 export TOKEN=$TOKEN
169
170 # Get TAGS from DOCKERHUB repository
171 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"]')
172 # Show TAGS
173 echo "MOONBEAM TAGS:"
174 echo $MOONBEAM_TAGS
175 # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS
176 if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then
177 echo "Repository has needed MOONBEAM version";
178 docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
179 else
180 echo "Repository has not needed MOONBEAM version, so build it";
181 cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .
182 echo "Push needed MOONBEAM version to the repository";
183 docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
184 fi
185 shell: bash
186
187
188 # Check CUMULUS version and build it if it doesn't exist in repository
189 - name: Generate ENV related extend Dockerfile file for CUMULUS
190 uses: cuchi/jinja2-action@v1.2.0
191 with:
192 template: .docker/Dockerfile-cumulus.j2
193 output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml
194 variables: |
195 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
196 CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
197
198 - name: Check if the dockerhub repository contains the needed CUMULUS version
199 run: |
200 # aquire token
201 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)
202 export TOKEN=$TOKEN
203
204 # Get TAGS from DOCKERHUB repository
205 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"]')
206 # Show TAGS
207 echo "CUMULUS TAGS:"
208 echo $CUMULUS_TAGS
209 # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS
210 if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then
211 echo "Repository has needed CUMULUS version";
212 docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
213 else
214 echo "Repository has not needed CUMULUS version, so build it";
215 cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .
216 echo "Push needed CUMULUS version to the repository";
217 docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
218 fi
219 shell: bash
220
221
222 # Build main image for XCM
223 - name: Generate ENV related extend Dockerfile file
224 uses: cuchi/jinja2-action@v1.2.0
225 with:
226 template: .docker/Dockerfile-xcm.j2
227 output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
228 variables: |
229 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
230 NETWORK=${{ matrix.network }}
231 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
232 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
233 FEATURE=${{ matrix.features }}
234 RUNTIME=${{ matrix.runtime }}
235 BRANCH=${{ github.head_ref }}
236 ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
237 MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
238 CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
239
240 - name: Show build Dockerfile
241 run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
242
243 - name: Show launch-config-xcm-${{ matrix.network }} configuration
244 run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
245
246 - name: Run find-and-replace to remove slashes from branch name
247 uses: mad9000/actions-find-and-replace-string@2
248 id: branchname
249 with:
250 source: ${{ github.head_ref }}
251 find: '/'
252 replace: '-'
253
254 - name: Pull chainql docker image
255 run: docker pull uniquenetwork/builder-chainql:latest
256
257 - name: Build the stack
258 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 .
259
260 - name: Push docker image version
261 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
262
263 - name: Push docker image latest
264 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
265
266 - name: Remove builder cache
267 if: always() # run this step always
268 run: |
269 docker builder prune -f
270 docker system prune -f
13271
14 xcm-tests:272 xcm-tests:
273 needs: xcm-build
274 # The type of runner that the job will run on
275 runs-on: [XL]
276
277 timeout-minutes: 600
278
279 name: ${{ matrix.network }}
280
281 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.
282
283 strategy:
284 matrix:
285 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
286
287 steps:
288 - name: Skip if pull request is in Draft
289 if: github.event.pull_request.draft == true
290 run: exit 1
291
292 - name: Clean Workspace
293 uses: AutoModality/action-clean@v1.1.0
294
295 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
296 - uses: actions/checkout@v3
297 with:
298 ref: ${{ github.head_ref }} #Checking out head commit
299
300 - name: Read .env file
301 uses: xom9ikk/dotenv@v1.0.2
302
303 - name: Generate ENV related extend file for docker-compose
304 uses: cuchi/jinja2-action@v1.2.0
305 with:
306 template: .docker/docker-compose.tmp-xcm-tests.j2
307 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
308 variables: |
309 NETWORK=${{ matrix.network }}
310
311 - name: Show build configuration
312 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
313
314 - uses: actions/setup-node@v3
315 with:
316 node-version: 16
317
318 - name: Build the stack
319 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
320
321 # πŸš€ POLKADOT LAUNCH COMPLETE πŸš€
322 - name: Check if docker logs consist messages related to testing of xcm tests
323 if: success()
324 run: |
325 counter=160
326 function check_container_status {
327 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
328 }
329 function do_docker_logs {
330 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
331 }
332 function is_started {
333 if [ "$(check_container_status)" == "true" ]; then
334 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";
335 echo "Check Docker logs"
336 DOCKER_LOGS=$(do_docker_logs)
337 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
338 echo "πŸš€ POLKADOT LAUNCH COMPLETE πŸš€"
339 return 0
340 else
341 echo "Message not found in logs output, repeating..."
342 return 1
343 fi
344 else
345 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"
346 echo "Halting all future checks"
347 exit 1
348 fi
349 echo "something goes wrong"
350 exit 1
351 }
352 while ! is_started; do
353 echo "Waiting for special message in log files "
354 sleep 30s
355 counter=$(( $counter - 1 ))
356 echo "Counter: $counter"
357 if [ "$counter" -gt "0" ]; then
358 continue
359 else
360 break
361 fi
362 done
363 echo "Halting script"
364 exit 0
365 shell: bash
366
15 name: tests367 - name: Run XCM tests
368 working-directory: tests
369 run: |
370 yarn install
371 yarn add mochawesome
372 node scripts/readyness.js
373 echo "Ready to start tests"
374 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
375
376 - name: XCM Test Report
16 needs: [ xcm-testnet-build ]377 uses: phoenix-actions/test-reporting@v8
378 id: test-report
379 if: success() || failure() # run this step even if previous step failed
380 with:
381 name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created
382 path: tests/mochawesome-report/test-*.json # Path to test results
383 reporter: mochawesome-json
384 fail-on-error: 'false'
385
386 - name: Stop running containers
387 if: always() # run this step always
388 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down
389
390 - name: Clean Workspace
391 if: always()
17 uses: ./.github/workflows/xcm-tests_v2.yml392 uses: AutoModality/action-clean@v1.1.0
393
394 - name: Remove builder cache
395 if: always() # run this step always
396 run: |
397 docker system prune -a -f
18398
19
20