1name: Develop - Build & test234on:5 6 pull_request:7 branches:8 - develop9 types:10 - opened11 - reopened12 - synchronize 1314 15 workflow_dispatch:161718env:19 RUST_TOOLCHAIN: nightly-2022-05-1120 REPO_URL: ${{ github.server_url }}/${{ github.repository }}21 POLKA_VERSION: release-v0.9.24222324jobs:25 build:26 27 runs-on: self-hosted-ci2829 name: Build Container, Spin it Up an test3031 continue-on-error: false 3233 strategy:34 matrix:35 include:36 - network: "Opal"37 features: "--features=opal-runtime"38 - network: "Quartz"39 features: "--features=quartz-runtime"40 - network: "Unique"41 features: "--features=unique-runtime"4243 steps:44 - name: Skip if pull request is in Draft45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 if: github.event.pull_request.draft == true60 run: exit 16162 63 - uses: actions/checkout@v364 with:65 ref: ${{ github.event.pull_request.head.sha }} 6667 - name: Generate ENV related extend file for docker-compose68 uses: cuchi/jinja2-action@v1.2.069 with:70 template: .docker/docker-compose.tmp.j271 output_file: .docker/docker-compose.${{ matrix.network }}.yml72 variables: |73 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git74 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}75 POLKA_VERSION=${{ env.POLKA_VERSION }}76 FEATURE=${{ matrix.features }}77 BRANCH=${{ github.head_ref }}7879 - name: Show build configuration80 run: cat .docker/docker-compose.${{ matrix.network }}.yml8182 - name: Build the stack83 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build8485 86 8788 - name: Install node89 uses: actions/setup-node@v190 with:91 node-version: 16.x9293 - name: Install dependencies94 run: |95 cd tests96 yarn install97 yarn add mochawesome98 yarn add @polkadot/api99 yarn --pure-lockfile100101 - name: Run tests102 run: |103 chmod u+x .docker/readyness.js && .docker/readyness.js104 cd tests105 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}106 env:107 RPC_URL: http://127.0.0.1:9933/108109 - name: Test Report110 uses: phoenix-actions/test-reporting@v8111 id: test-report 112 if: success() || failure() 113 with:114 name: Tests ${{ matrix.network }} 115 path: tests/mochawesome-report/test-*.json 116 reporter: mochawesome-json117 fail-on-error: 'false'118119 - name: Stop running containers120 if: always() 121 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down