git.delta.rocks / unique-network / refs/commits / 032326eb63c9

difftreelog

source

.github/workflows/node_build_test.yml4.6 KiBsourcehistory
1name: Yarn test dev23# Controls when the action will run.4on:5 # Triggers the workflow on push or pull request events but only for the master branch6  pull_request:7    branches:8      - develop9    types:10      - opened11      - reopened12      - synchronize   #commit(s) pushed to the pull request13      - ready_for_review1415  # Allows you to run this workflow manually from the Actions tab16  workflow_dispatch:1718#Define Workflow variables19env:20  REPO_URL: ${{ github.server_url }}/${{ github.repository }}2122concurrency: 23  group: ${{ github.workflow }}-${{ github.ref }}24  cancel-in-progress: true2526# A workflow run is made up of one or more jobs that can run sequentially or in parallel27jobs:28  dev_build_test:29    # The type of runner that the job will run on30    runs-on: [self-hosted-ci,medium]31    timeout-minutes: 13803233    name: ${{ matrix.network }}3435    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.3637    strategy:38      matrix:39        include:40          - network: "Opal"41            features: "opal-runtime"42          - network: "Quartz"43            features: "quartz-runtime"44          - network: "Unique"45            features: "unique-runtime"4647    steps:48      - name: Skip if pull request is in Draft49        # `if: github.event.pull_request.draft == true` should be kept here, at50        # the step level, rather than at the job level. The latter is not51        # recommended because when the PR is moved from "Draft" to "Ready to52        # review" the workflow will immediately be passing (since it was skipped),53        # even though it hasn't actually ran, since it takes a few seconds for54        # the workflow to start. This is also disclosed in:55        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1756        # That scenario would open an opportunity for the check to be bypassed:57        # 1. Get your PR approved58        # 2. Move it to Draft59        # 3. Push whatever commits you want60        # 4. Move it to "Ready for review"; now the workflow is passing (it was61        #    skipped) and "Check reviews" is also passing (it won't be updated62        #    until the workflow is finished)63        if: github.event.pull_request.draft == true64        run: exit 16566      - name: Clean Workspace67        uses: AutoModality/action-clean@v1.1.06869      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it70      - uses: actions/checkout@v371        with:72          ref: ${{ github.head_ref }}  #Checking out head commit7374      - name: Read .env file75        uses: xom9ikk/dotenv@v1.0.27677      - name: Generate ENV related extend file for docker-compose78        uses: cuchi/jinja2-action@v1.2.079        with:80          template: .docker/docker-compose.tmp.j281          output_file: .docker/docker-compose.${{ matrix.network }}.yml82          variables: |83            REPO_URL=${{ github.server_url }}/${{ github.repository }}.git84            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}85            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}86            FEATURE=${{ matrix.features }}87            BRANCH=${{ github.head_ref }}8889      - name: Show build configuration90        run: cat .docker/docker-compose.${{ matrix.network }}.yml9192      - name: Build the stack93        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build9495      - uses: actions/setup-node@v396        with:97          node-version: 169899      - name: Run tests100        run: |101          cd tests102          yarn install103          yarn add mochawesome104          echo "Ready to start tests"105          node scripts/readyness.js106          NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}107        env:108          RPC_URL: http://127.0.0.1:9933/109110      - name: Test Report111        uses: phoenix-actions/test-reporting@v8112        id: test-report113        if: success() || failure()    # run this step even if previous step failed114        with:115          name: Tests ${{ matrix.network }}            # Name of the check run which will be created116          path: tests/mochawesome-report/test-*.json    # Path to test results117          reporter: mochawesome-json118          fail-on-error: 'false'119120      - name: Read output variables121        run: |122          echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"123124      - name: Stop running containers125        if: always()                   # run this step always126        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down