12name: governance tests345on:6 workflow_call:789jobs:10 prepare-execution-marix:11 name: Prepare execution matrix1213 runs-on: self-hosted-ci14 outputs:15 matrix: ${{ steps.create_matrix.outputs.matrix }}1617 steps:18 - name: Clean Workspace19 uses: AutoModality/action-clean@v1.1.02021 22 - uses: actions/checkout@v3.1.023 with:24 ref: ${{ github.head_ref }} 2526 - name: Read .env file27 uses: xom9ikk/dotenv@v22829 - name: Create Execution matrix30 uses: CertainLach/create-matrix-action@v431 id: create_matrix32 with:33 matrix: |34 network {unique}, wasm_name {unique}35 network {quartz}, wasm_name {quartz}36 network {opal}, wasm_name {opal}37 network {sapphire}, wasm_name {quartz}3839 dev_build_int_tests:40 needs: prepare-execution-marix41 42 runs-on: [self-hosted-ci, medium]43 timeout-minutes: 13804445 name: ${{ matrix.network }}46 strategy:47 matrix:48 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}4950 continue-on-error: true 5152 steps:53 - name: Clean Workspace54 uses: AutoModality/action-clean@v1.1.05556 57 - uses: actions/checkout@v3.1.058 with:59 ref: ${{ github.head_ref }} 6061 - name: Read .env file62 uses: xom9ikk/dotenv@v26364 - name: Generate ENV related extend file for docker-compose65 uses: cuchi/jinja2-action@v1.2.066 with:67 template: .docker/docker-compose.gov.j268 output_file: .docker/docker-compose.${{ matrix.network }}.yml69 variables: |70 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}71 NETWORK=${{ matrix.network }}72 WASM_NAME=${{ matrix.wasm_name }}7374 - name: Show build configuration75 run: cat .docker/docker-compose.${{ matrix.network }}.yml7677 - name: Build the stack78 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans7980 - uses: actions/setup-node@v3.5.181 with:82 node-version: 188384 - name: Run tests85 working-directory: js-packages/tests86 run: |87 yarn install88 yarn add mochawesome89 ../scripts/src/generate_types/wait_for_first_block.sh90 echo "Ready to start tests"91 NOW=$(date +%s) && yarn testGovernance --reporter mochawesome --reporter-options reportFilename=test-${NOW}92 env:93 RPC_URL: http://127.0.0.1:9944/9495 - name: Test Report96 uses: phoenix-actions/test-reporting@v1097 id: test-report98 if: success() || failure() 99 with:100 name: int test results - ${{ matrix.network }} 101 path: js-packages/tests/mochawesome-report/test-*.json 102 reporter: mochawesome-json103 fail-on-error: 'false'104105 - name: Read output variables106 run: |107 echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"108109 - name: Stop running containers110 if: always() 111 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down112113 - name: Remove builder cache114 if: always() 115 run: |116 docker builder prune -f -a117 docker system prune -f118 docker image prune -f -a