git.delta.rocks / unique-network / refs/commits / ca21272ac646

difftreelog

source

.github/workflows/node_build_test.yml4.5 KiBsourcehistory
1name: Build & test23# Controls when the action will run.4on:5 # Triggers the workflow on push or pull request events but only for the master branch6  #push:7  #  branches: [ develop ]8  pull_request:9    branches:10      - develop11    types:12      - opened13      - edited14      - reopened15  # pull_request:16 #   branches: [ develop ]17  # Allows you to run this workflow manually from the Actions tab18  workflow_dispatch:1920#Define Workflow variables21env:22  ubuntu_version: focal23  chains_release_dir: /opt/runner/chains_release24  opal_chain_workdir: ./src_opal_chain25  quartz_chain_workdir: ./src_quartz_chain26  unique_chain_workdir: ./src_unique_chain27  src_repo_url: https://github.com/lzadjsf/unique-chain.git28  RUST_TOOLCHAIN: nightly-2022-05-1129  REPO_URL: ${{ github.server_url }}/${{ github.repository }}3031# A workflow run is made up of one or more jobs that can run sequentially or in parallel32jobs:33  pre-requisites:34    # The type of runner that the job will run on35    runs-on: self-hosted-ci3637    steps:38      #runs ssh connection39      - name: Install dependencies40        run: |41          sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake42          sudo apt autoremove43          curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none44          . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm45          rustup toolchain install ${{ env.RUST_TOOLCHAIN }}46          rustup default ${{ env.RUST_TOOLCHAIN }}47          rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }}484950  build:51    # The type of runner that the job will run on52    runs-on: self-hosted-ci5354    needs: pre-requisites55    name: Build Container, Spin it Up an test5657    continue-on-error: true         #Do not stop testing of matrix runs failed.5859    strategy:60      matrix:61        include:62          - network: "Opal"63            features: " "64          - network: "Quartz"65            features: "--features=quartz-runtime"66          - network: "Unique"67            features: "--features=unique-runtime"6869    steps:70      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it71      - uses: actions/checkout@v37273      - name: Generate ENV related extend file for docker-compose74        uses: cuchi/jinja2-action@v1.2.075        with:76          template: .docker/docker-compose.tmp.j277          output_file: .docker/docker-compose.${{ matrix.network }}.yml78          variables: |79            REPO_URL=${{ github.server_url }}/${{ github.repository }}.git80            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}81            FEATURE=${{ matrix.features }}82            BRANCH=${{ github.head_ref }}8384      - name: Show temporary file85        run: cat .docker/docker-compose.${{ matrix.network }}.yml8687      - name: Build the stack88        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build8990#      - name: "Build the Docker image with Feature: ${{ env.features }}"91#        run: docker build -t build-${{ github.head_ref }} --file .docker/Dockerfile-chain-dev --build-arg REPO_URL=${{ github.server_url }}/${{ github.repository }}.git --build-arg RUST_TOOLCHAIN=${{ env.actual_toolchain }} --build-arg FEATURE="${{ env.features }}" --build-arg BRANCH=${{ github.head_ref }} --no-cache .9293      - name: Wait94        run: sleep 420s9596      - name: Install node97        uses: actions/setup-node@v198        with:99          node-version: 14.x100101      - name: Install dependencies102        run: |103          cd tests104          yarn install105          yarn add mochawesome106          yarn --pure-lockfile107108      - name: Run tests109        run: |110          cd tests111          NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}112        env:113          RPC_URL: http://127.0.0.1:9933/114115      - name: Test Report116        uses: phoenix-actions/test-reporting@v8117        id: test-report               # Set ID reference for step118        if: success() || failure()    # run this step even if previous step failed119        with:120          name: Tests ${{ matrix.network }}            # Name of the check run which will be created121          path: tests/mochawesome-report/test-*.json    # Path to test results122          reporter: mochawesome-json123          fail-on-error: 'false'124125      - name: Stop running containers126        if: always()                   # run this step always127        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down