difftreelog
another trigger for xcm tests workflows
in: master
2 files changed
.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
.github/workflows/xcm-tests.ymldiffbeforeafterboth1name: 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 -f1901name: xcm-tests23# Controls when the action will run.4on:5 # Triggers the workflow on push or pull request events but only for the master branch6 pull_request:7 branches:8 - master9 types:10 - opened11 - reopened12 - synchronize #commit(s) pushed to the pull request13 - ready_for_review1415 # Allows you to run this workflow manually from the Actions tab16 workflow_dispatch:1718#Define Workflow variables19env:20 REPO_URL: ${{ github.server_url }}/${{ github.repository }}2122concurrency:23 group: ${{ github.workflow }}-${{ github.head_ref }}24 cancel-in-progress: true2526# A workflow run is made up of one or more jobs that can run sequentially or in parallel27jobs:2829 xcm-testnet-build:30 uses: ./.github/workflows/xcm-testnet-build.yml31 secrets: inherit3233 prepare-execution-marix:3435 name: Prepare execution matrix3637 needs: [xcm-testnet-build]3839 runs-on: XL40 outputs:41 matrix: ${{ steps.create_matrix.outputs.matrix }}4243 steps:4445 - name: Clean Workspace46 uses: AutoModality/action-clean@v1.1.04748 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it49 - uses: actions/checkout@v350 with:51 ref: ${{ github.head_ref }} #Checking out head commit5253 - name: Read .env file54 uses: xom9ikk/dotenv@v1.0.25556 - name: Create Execution matrix57 uses: fabiocaccamo/create-matrix-action@v258 id: create_matrix59 with:60 matrix: |61 network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}62 network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}63 network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}6465 xcm-tests:66 needs: prepare-execution-marix67 # The type of runner that the job will run on68 runs-on: [XL]6970 timeout-minutes: 6007172 name: ${{ matrix.network }}7374 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.7576 strategy:77 matrix:78 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}798081 steps:82 - name: Skip if pull request is in Draft83 if: github.event.pull_request.draft == true84 run: exit 18586 - name: Clean Workspace87 uses: AutoModality/action-clean@v1.1.08889 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it90 - uses: actions/checkout@v391 with:92 ref: ${{ github.head_ref }} #Checking out head commit9394 - name: Read .env file95 uses: xom9ikk/dotenv@v1.0.29697 - name: Generate ENV related extend file for docker-compose98 uses: cuchi/jinja2-action@v1.2.099 with:100 template: .docker/docker-compose.tmp-xcm-tests.j2101 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml102 variables: |103 NETWORK=${{ matrix.network }}104105 - name: Show build configuration106 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml107108 - uses: actions/setup-node@v3109 with:110 node-version: 16111112 - name: Build the stack113 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300114115 # π POLKADOT LAUNCH COMPLETE π116 - name: Check if docker logs consist messages related to testing of xcm tests 117 if: success()118 run: |119 counter=160120 function check_container_status {121 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local122 }123 function do_docker_logs {124 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1125 }126 function is_started {127 if [ "$(check_container_status)" == "true" ]; then128 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";129 echo "Check Docker logs"130 DOCKER_LOGS=$(do_docker_logs)131 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then132 echo "π POLKADOT LAUNCH COMPLETE π"133 return 0134 else135 echo "Message not found in logs output, repeating..."136 return 1137 fi138 else139 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"140 echo "Halting all future checks"141 exit 1142 fi143 echo "something goes wrong"144 exit 1145 }146 while ! is_started; do147 echo "Waiting for special message in log files "148 sleep 30s149 counter=$(( $counter - 1 ))150 echo "Counter: $counter"151 if [ "$counter" -gt "0" ]; then152 continue153 else154 break155 fi156 done157 echo "Halting script"158 exit 0159 shell: bash160161 - name: Run XCM tests 162 working-directory: tests163 run: |164 yarn install165 yarn add mochawesome166 echo "Ready to start tests"167 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}168169 - name: XCM Test Report170 uses: phoenix-actions/test-reporting@v8171 id: test-report172 if: success() || failure() # run this step even if previous step failed173 with:174 name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created175 path: tests/mochawesome-report/test-*.json # Path to test results176 reporter: mochawesome-json177 fail-on-error: 'false'178179 - name: Stop running containers180 if: always() # run this step always181 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down182183 - name: Clean Workspace184 if: always()185 uses: AutoModality/action-clean@v1.1.0186187 - name: Remove builder cache188 if: always() # run this step always189 run: |190 docker system prune -a -f191