1name: xcm-tests234on:5 6 workflow_call:789env:10 REPO_URL: ${{ github.server_url }}/${{ github.repository }}11121314jobs:1516 prepare-execution-marix:1718 name: Prepare execution matrix19202122 runs-on: XL23 outputs:24 matrix: ${{ steps.create_matrix.outputs.matrix }}2526 steps:2728 - name: Clean Workspace29 uses: AutoModality/action-clean@v1.1.03031 32 - uses: actions/checkout@v333 with:34 ref: ${{ github.head_ref }} 3536 - name: Read .env file37 uses: xom9ikk/dotenv@v1.0.23839 - name: Create Execution matrix40 uses: fabiocaccamo/create-matrix-action@v241 id: create_matrix42 with:43 matrix: |44 network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}45 network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}46 network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}4748 xcm-tests:49 needs: prepare-execution-marix50 51 runs-on: [XL]5253 timeout-minutes: 6005455 name: ${{ matrix.network }}5657 continue-on-error: true 5859 strategy:60 matrix:61 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}6263<<<<<<< HEAD64=======6566>>>>>>> develop67 steps:68 - name: Skip if pull request is in Draft69 if: github.event.pull_request.draft == true70 run: exit 17172 - name: Clean Workspace73 uses: AutoModality/action-clean@v1.1.07475 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it76 - uses: actions/checkout@v377 with:78 ref: ${{ github.head_ref }} #Checking out head commit7980 - name: Read .env file81 uses: xom9ikk/dotenv@v1.0.28283 - name: Generate ENV related extend file for docker-compose84 uses: cuchi/jinja2-action@v1.2.085 with:86 template: .docker/docker-compose.tmp-xcm-tests.j287 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml88 variables: |89 NETWORK=${{ matrix.network }}9091 - name: Show build configuration92 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml9394 - uses: actions/setup-node@v395 with:96 node-version: 169798 - name: Build the stack99 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300100101 # 🚀 POLKADOT LAUNCH COMPLETE 🚀102 - name: Check if docker logs consist messages related to testing of xcm tests 103 if: success()104 run: |105 counter=160106 function check_container_status {107 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local108 }109 function do_docker_logs {110 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1111 }112 function is_started {113 if [ "$(check_container_status)" == "true" ]; then114 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";115 echo "Check Docker logs"116 DOCKER_LOGS=$(do_docker_logs)117 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then118 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"119 return 0120 else121 echo "Message not found in logs output, repeating..."122 return 1123 fi124 else125 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"126 echo "Halting all future checks"127 exit 1128 fi129 echo "something goes wrong"130 exit 1131 }132 while ! is_started; do133 echo "Waiting for special message in log files "134 sleep 30s135 counter=$(( $counter - 1 ))136 echo "Counter: $counter"137 if [ "$counter" -gt "0" ]; then138 continue139 else140 break141 fi142 done143 echo "Halting script"144 exit 0145 shell: bash146147 - name: Run XCM tests 148 working-directory: tests149 run: |150 yarn install151 yarn add mochawesome152 node scripts/readyness.js153 echo "Ready to start tests"154 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}155156 - name: XCM Test Report157 uses: phoenix-actions/test-reporting@v8158 id: test-report159 if: success() || failure() # run this step even if previous step failed160 with:161 name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created162 path: tests/mochawesome-report/test-*.json # Path to test results163 reporter: mochawesome-json164 fail-on-error: 'false'165166 - name: Stop running containers167 if: always() # run this step always168 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down169170 - name: Clean Workspace171 if: always()172 uses: AutoModality/action-clean@v1.1.0173174 - name: Remove builder cache175 if: always() # run this step always176 run: |177 docker system prune -a -f178