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 {quartz}, wasm_name {quartz}35 network {opal}, wasm_name {opal}36 network {sapphire}, wasm_name {quartz}3738 dev_build_int_tests:39 needs: prepare-execution-marix40 41 runs-on: [self-hosted-ci, medium]42 timeout-minutes: 13804344 name: ${{ matrix.network }}45 strategy:46 matrix:47 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}4849 continue-on-error: true 5051 steps:52 - name: Clean Workspace53 uses: AutoModality/action-clean@v1.1.05455 56 - uses: actions/checkout@v3.1.057 with:58 ref: ${{ github.head_ref }} 5960 - name: Read .env file61 uses: xom9ikk/dotenv@v26263 - name: Generate ENV related extend file for docker-compose64 uses: cuchi/jinja2-action@v1.2.065 with:66 template: .docker/docker-compose.gov.j267 output_file: .docker/docker-compose.${{ matrix.network }}.yml68 variables: |69 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}70 NETWORK=${{ matrix.network }}71 WASM_NAME=${{ matrix.wasm_name }}7273 - name: Show build configuration74 run: cat .docker/docker-compose.${{ matrix.network }}.yml7576 - name: Build the stack77 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans7879 - uses: actions/setup-node@v3.5.180 with:81 node-version: 168283 - name: Run tests84 working-directory: tests85 run: |86 yarn install87 yarn add mochawesome88 ./scripts/wait_for_first_block.sh89 echo "Ready to start tests"90 NOW=$(date +%s) && yarn testGovernance --reporter mochawesome --reporter-options reportFilename=test-${NOW}91 env:92 RPC_URL: http://127.0.0.1:9944/9394 - name: Test Report95 uses: phoenix-actions/test-reporting@v1096 id: test-report97 if: success() || failure() 98 with:99 name: int test results - ${{ matrix.network }} 100 path: tests/mochawesome-report/test-*.json 101 reporter: mochawesome-json102 fail-on-error: 'false'103104 - name: Read output variables105 run: |106 echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"107108 - name: Stop running containers109 if: always() 110 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down111112 - name: Remove builder cache113 if: always() 114 run: |115 docker builder prune -f -a116 docker system prune -f117 docker image prune -f -a