git.delta.rocks / unique-network / refs/commits / 58bdab80d979

difftreelog

another trigger for xcm tests workflows

Konstantin Astakhov2022-09-02parent: #3c3c01d.patch.diff
in: master

2 files changed

modified.github/workflows/xcm-testnet-build.ymldiffbeforeafterboth
--- a/.github/workflows/xcm-testnet-build.yml
+++ b/.github/workflows/xcm-testnet-build.yml
@@ -2,16 +2,8 @@
 
 # Controls when the action will run.
 on:
- # Triggers the workflow on push or pull request events but only for the master branch
-  pull_request:
-    branches:
-      - master
-    types:
-      - opened
-      - reopened
-      - synchronize   #commit(s) pushed to the pull request
-      - ready_for_review
-
+  workflow_call:
+  
   # Allows you to run this workflow manually from the Actions tab
   workflow_dispatch:
 
@@ -19,10 +11,6 @@
 env:
   REPO_URL: ${{ github.server_url }}/${{ github.repository }}
 
-concurrency:
-  group: ${{ github.workflow }}-${{ github.head_ref }}
-  cancel-in-progress: true
-
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
 
@@ -71,12 +59,11 @@
     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: 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
modified.github/workflows/xcm-tests.ymldiffbeforeafterboth
before · .github/workflows/xcm-tests.yml
1name: xcm-tests23# Controls when the action will run.4on:5 # Triggers the workflow after xcm-testnet-build 6  workflow_run:7    workflows: ["xcm-testnet-build"]8    types: 9      - completed  10 # Triggers the workflow on push or pull request events but only for the master branch11  pull_request:12    branches:13      - master14    types:15      - opened16      - reopened17      - synchronize   #commit(s) pushed to the pull request18      - ready_for_review1920  # Allows you to run this workflow manually from the Actions tab21  workflow_dispatch:2223#Define Workflow variables24env:25  REPO_URL: ${{ github.server_url }}/${{ github.repository }}2627concurrency:28  group: ${{ github.workflow }}-${{ github.head_ref }}29  cancel-in-progress: true3031# A workflow run is made up of one or more jobs that can run sequentially or in parallel32jobs:3334  prepare-execution-marix:3536    name: Prepare execution matrix3738    runs-on: XL39    outputs:40      matrix: ${{ steps.create_matrix.outputs.matrix }}4142    steps:4344      - name: Clean Workspace45        uses: AutoModality/action-clean@v1.1.04647      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it48      - uses: actions/checkout@v349        with:50          ref: ${{ github.head_ref }}  #Checking out head commit5152      - name: Read .env file53        uses: xom9ikk/dotenv@v1.0.25455      - name: Create Execution matrix56        uses: fabiocaccamo/create-matrix-action@v257        id: create_matrix58        with:59          matrix: |60            network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}61            network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}62            network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}6364  xcm-tests:65    needs: prepare-execution-marix66    # The type of runner that the job will run on67    runs-on: [XL]6869    timeout-minutes: 6007071    name: ${{ matrix.network }}7273    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.7475    strategy:76      matrix:77        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}787980    steps:81      # - name: Skip if pull request is in Draft82      #  if: github.event.pull_request.draft == true83      #  run: exit 18485      - name: Clean Workspace86        uses: AutoModality/action-clean@v1.1.08788      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it89      - uses: actions/checkout@v390        with:91          ref: ${{ github.head_ref }}  #Checking out head commit9293      - name: Read .env file94        uses: xom9ikk/dotenv@v1.0.29596      - name: Generate ENV related extend file for docker-compose97        uses: cuchi/jinja2-action@v1.2.098        with:99          template: .docker/docker-compose.tmp-xcm-tests.j2100          output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml101          variables: |102            NETWORK=${{ matrix.network }}103104      - name: Show build configuration105        run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml106107      - uses: actions/setup-node@v3108        with:109          node-version: 16110111      - name: Build the stack112        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300113114      #  🚀 POLKADOT LAUNCH COMPLETE 🚀115      - name: Check if docker logs consist messages related to testing of xcm tests 116        if: success()117        run: |118          counter=160119          function check_container_status {120                docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local121          }122          function do_docker_logs {123                docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1124          }125          function is_started {126                if [ "$(check_container_status)" == "true" ]; then127                        echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";128                        echo "Check Docker logs"129                        DOCKER_LOGS=$(do_docker_logs)130                        if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then131                                echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"132                                return 0133                        else134                                echo "Message not found in logs output, repeating..."135                                return 1136                        fi137                else138                        echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"139                        echo "Halting all future checks"140                        exit 1141                fi142          echo "something goes wrong"143          exit 1144          }145          while ! is_started; do146                echo "Waiting for special message in log files "147                sleep 30s148                counter=$(( $counter - 1 ))149                echo "Counter: $counter"150                if [ "$counter" -gt "0" ]; then151                         continue152                else153                         break154                fi155          done156          echo "Halting script"157          exit 0158        shell: bash159160      - name: Run XCM tests 161        working-directory: tests162        run: |163          yarn install164          yarn add mochawesome165          echo "Ready to start tests"166          NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}167168      - name: XCM Test Report169        uses: phoenix-actions/test-reporting@v8170        id: test-report171        if: success() || failure()    # run this step even if previous step failed172        with:173          name: XCM Tests ${{ matrix.network }}            # Name of the check run which will be created174          path: tests/mochawesome-report/test-*.json    # Path to test results175          reporter: mochawesome-json176          fail-on-error: 'false'177178      - name: Stop running containers179        if: always()                   # run this step always180        run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down181182      - name: Clean Workspace183        if: always()184        uses: AutoModality/action-clean@v1.1.0185186      - name: Remove builder cache187        if: always()                   # run this step always188        run: |189          docker system prune -a -f190