git.delta.rocks / unique-network / refs/commits / 8522be9745b8

difftreelog

source

.github/workflows/build-test-master.yml4.5 KiBsourcehistory
1name: Build & Test Master23# 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      - master11    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  RUST_TOOLCHAIN: nightly-2022-05-1128  REPO_URL: ${{ github.server_url }}/${{ github.repository }}2930# A workflow run is made up of one or more jobs that can run sequentially or in parallel31jobs:32  pre-requisites:33    # The type of runner that the job will run on34    runs-on: self-hosted-ci3536    steps:37      #runs ssh connection38      - name: Install dependencies39        run: |40          sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake41          sudo apt autoremove42          curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none43          . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm44          rustup toolchain install ${{ env.RUST_TOOLCHAIN }}45          rustup default ${{ env.RUST_TOOLCHAIN }}46          rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }}474849  build:50    # The type of runner that the job will run on51    runs-on: self-hosted-ci5253    needs: pre-requisites54    name: Build Container, Spin it Up an test5556    continue-on-error: true         #Do not stop testing of matrix runs failed.5758    strategy:59      matrix:60        include:61          - network: "Opal"62            features: " "63          - network: "Quartz"64            features: "--features=quartz-runtime"65          - network: "Unique"66            features: "--features=unique-runtime"6768    steps:69      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it70      - uses: actions/checkout@v37172      - name: Generate ENV related extend file for docker-compose73        uses: cuchi/jinja2-action@v1.2.074        with:75          template: .docker/docker-compose.tmp-master.j276          output_file: .docker/docker-compose.${{ matrix.network }}.yml77          variables: |78            REPO_URL=${{ github.server_url }}/${{ github.repository }}.git79            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}80            FEATURE=${{ matrix.features }}81            BRANCH=${{ github.head_ref }}8283      - name: Show temporary file84        run: cat .docker/docker-compose.${{ matrix.network }}.yml8586      - name: Build the stack87        run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build8889#      - name: "Build the Docker image with Feature: ${{ env.features }}"90#        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 .9192      - name: Wait93        run: sleep 420s9495      - name: Install node96        uses: actions/setup-node@v197        with:98          node-version: 14.x99100      - name: Install dependencies101        run: |102          cd tests103          yarn install104          yarn add mochawesome105          yarn --pure-lockfile106107      - name: Run tests108        run: |109          cd tests110          NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}111        env:112          RPC_URL: http://127.0.0.1:9933/113114      - name: Test Report115        uses: phoenix-actions/test-reporting@v8116        id: test-report               # Set ID reference for step117        if: success() || failure()    # run this step even if previous step failed118        with:119          name: Tests ${{ matrix.network }}            # Name of the check run which will be created120          path: tests/mochawesome-report/test-*.json    # Path to test results121          reporter: mochawesome-json122          fail-on-error: 'false'123124      - name: Stop running containers125        if: always()                   # run this step always126        run: docker-compose -f ".docker/docker-compose-tests-parachain.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down