difftreelog
add runs_on
in: master
1 file changed
.github/workflows/xcm-tests_v2.ymldiffbeforeafterboth1name: xcm-tests23# Controls when the action will run.4on:5 # Allows you to run this workflow manually from the Actions tab6 workflow_call:78#Define Workflow variables9env:10 REPO_URL: ${{ github.server_url }}/${{ github.repository }}111213# A workflow run is made up of one or more jobs that can run sequentially or in parallel14jobs:1516 xcm-build-results:17 steps:18 - name: print previous job results19 run: echo ${{needs.xcm-testnet-build.result}}2021 prepare-execution-marix:2223 name: Prepare execution matrix2425# needs: [xcm-testnet-build]2627 runs-on: XL28 outputs:29 matrix: ${{ steps.create_matrix.outputs.matrix }}3031 steps:3233 - name: Clean Workspace34 uses: AutoModality/action-clean@v1.1.03536 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it37 - uses: actions/checkout@v338 with:39 ref: ${{ github.head_ref }} #Checking out head commit4041 - name: Read .env file42 uses: xom9ikk/dotenv@v1.0.24344 - name: Create Execution matrix45 uses: fabiocaccamo/create-matrix-action@v246 id: create_matrix47 with:48 matrix: |49 network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}50 network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}51 network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}5253 xcm-tests:54 needs: prepare-execution-marix55 # The type of runner that the job will run on56 runs-on: [XL]5758 timeout-minutes: 6005960 name: ${{ matrix.network }}6162 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.6364 strategy:65 matrix:66 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}676869 steps:70 - name: Skip if pull request is in Draft71 if: github.event.pull_request.draft == true72 run: exit 17374 - name: Clean Workspace75 uses: AutoModality/action-clean@v1.1.07677 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it78 - uses: actions/checkout@v379 with:80 ref: ${{ github.head_ref }} #Checking out head commit8182 - name: Read .env file83 uses: xom9ikk/dotenv@v1.0.28485 - name: Generate ENV related extend file for docker-compose86 uses: cuchi/jinja2-action@v1.2.087 with:88 template: .docker/docker-compose.tmp-xcm-tests.j289 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml90 variables: |91 NETWORK=${{ matrix.network }}9293 - name: Show build configuration94 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml9596 - uses: actions/setup-node@v397 with:98 node-version: 1699100 - name: Build the stack101 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300102103 # π POLKADOT LAUNCH COMPLETE π104 - name: Check if docker logs consist messages related to testing of xcm tests 105 if: success()106 run: |107 counter=160108 function check_container_status {109 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local110 }111 function do_docker_logs {112 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1113 }114 function is_started {115 if [ "$(check_container_status)" == "true" ]; then116 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";117 echo "Check Docker logs"118 DOCKER_LOGS=$(do_docker_logs)119 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then120 echo "π POLKADOT LAUNCH COMPLETE π"121 return 0122 else123 echo "Message not found in logs output, repeating..."124 return 1125 fi126 else127 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"128 echo "Halting all future checks"129 exit 1130 fi131 echo "something goes wrong"132 exit 1133 }134 while ! is_started; do135 echo "Waiting for special message in log files "136 sleep 30s137 counter=$(( $counter - 1 ))138 echo "Counter: $counter"139 if [ "$counter" -gt "0" ]; then140 continue141 else142 break143 fi144 done145 echo "Halting script"146 exit 0147 shell: bash148149 - name: Run XCM tests 150 working-directory: tests151 run: |152 yarn install153 yarn add mochawesome154 node scripts/readyness.js155 echo "Ready to start tests"156 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}157158 - name: XCM Test Report159 uses: phoenix-actions/test-reporting@v8160 id: test-report161 if: success() || failure() # run this step even if previous step failed162 with:163 name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created164 path: tests/mochawesome-report/test-*.json # Path to test results165 reporter: mochawesome-json166 fail-on-error: 'false'167168 - name: Stop running containers169 if: always() # run this step always170 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down171172 - name: Clean Workspace173 if: always()174 uses: AutoModality/action-clean@v1.1.0175176 - name: Remove builder cache177 if: always() # run this step always178 run: |179 docker system prune -a -f1801name: xcm-tests23# Controls when the action will run.4on:5 # Allows you to run this workflow manually from the Actions tab6 workflow_call:78#Define Workflow variables9env:10 REPO_URL: ${{ github.server_url }}/${{ github.repository }}111213# A workflow run is made up of one or more jobs that can run sequentially or in parallel14jobs:1516 xcm-build-results:17 runs-on: medium18 steps:19 - name: print previous job results20 run: echo ${{needs.xcm-testnet-build.result}}2122 prepare-execution-marix:2324 name: Prepare execution matrix2526# needs: [xcm-testnet-build]2728 runs-on: XL29 outputs:30 matrix: ${{ steps.create_matrix.outputs.matrix }}3132 steps:3334 - name: Clean Workspace35 uses: AutoModality/action-clean@v1.1.03637 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it38 - uses: actions/checkout@v339 with:40 ref: ${{ github.head_ref }} #Checking out head commit4142 - name: Read .env file43 uses: xom9ikk/dotenv@v1.0.24445 - name: Create Execution matrix46 uses: fabiocaccamo/create-matrix-action@v247 id: create_matrix48 with:49 matrix: |50 network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}51 network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}52 network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}5354 xcm-tests:55 needs: prepare-execution-marix56 # The type of runner that the job will run on57 runs-on: [XL]5859 timeout-minutes: 6006061 name: ${{ matrix.network }}6263 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.6465 strategy:66 matrix:67 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}686970 steps:71 - name: Skip if pull request is in Draft72 if: github.event.pull_request.draft == true73 run: exit 17475 - name: Clean Workspace76 uses: AutoModality/action-clean@v1.1.07778 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it79 - uses: actions/checkout@v380 with:81 ref: ${{ github.head_ref }} #Checking out head commit8283 - name: Read .env file84 uses: xom9ikk/dotenv@v1.0.28586 - name: Generate ENV related extend file for docker-compose87 uses: cuchi/jinja2-action@v1.2.088 with:89 template: .docker/docker-compose.tmp-xcm-tests.j290 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml91 variables: |92 NETWORK=${{ matrix.network }}9394 - name: Show build configuration95 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml9697 - uses: actions/setup-node@v398 with:99 node-version: 16100101 - name: Build the stack102 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300103104 # π POLKADOT LAUNCH COMPLETE π105 - name: Check if docker logs consist messages related to testing of xcm tests 106 if: success()107 run: |108 counter=160109 function check_container_status {110 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local111 }112 function do_docker_logs {113 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1114 }115 function is_started {116 if [ "$(check_container_status)" == "true" ]; then117 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";118 echo "Check Docker logs"119 DOCKER_LOGS=$(do_docker_logs)120 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then121 echo "π POLKADOT LAUNCH COMPLETE π"122 return 0123 else124 echo "Message not found in logs output, repeating..."125 return 1126 fi127 else128 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"129 echo "Halting all future checks"130 exit 1131 fi132 echo "something goes wrong"133 exit 1134 }135 while ! is_started; do136 echo "Waiting for special message in log files "137 sleep 30s138 counter=$(( $counter - 1 ))139 echo "Counter: $counter"140 if [ "$counter" -gt "0" ]; then141 continue142 else143 break144 fi145 done146 echo "Halting script"147 exit 0148 shell: bash149150 - name: Run XCM tests 151 working-directory: tests152 run: |153 yarn install154 yarn add mochawesome155 node scripts/readyness.js156 echo "Ready to start tests"157 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}158159 - name: XCM Test Report160 uses: phoenix-actions/test-reporting@v8161 id: test-report162 if: success() || failure() # run this step even if previous step failed163 with:164 name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created165 path: tests/mochawesome-report/test-*.json # Path to test results166 reporter: mochawesome-json167 fail-on-error: 'false'168169 - name: Stop running containers170 if: always() # run this step always171 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down172173 - name: Clean Workspace174 if: always()175 uses: AutoModality/action-clean@v1.1.0176177 - name: Remove builder cache178 if: always() # run this step always179 run: |180 docker system prune -a -f181