difftreelog
Merge pull request #15 from lzadjsf/ci-build-workflow-v3
in: master
Removed un-needed artefacts. Added additional build ARGS.
17 files changed
.docker/.envdiffbeforeafterbothno changes
.docker/Dockerfile-chain-devdiffbeforeafterboth101011RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none11RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none121213ARG RUST_TOOLCHAIN=nightly-2022-04-0713ARG RUST_TOOLCHAIN=nightly-2022-05-1114ARG BRANCH=develop14ARG POLKA_VERSION=release-v0.9.2415ARG BRANCH=15ARG REPO_URL=https://github.com/UniqueNetwork/unique-chain.git16ARG REPO_URL=16ARG FEATURE=17ARG FEATURE=171818RUN rustup toolchain uninstall $(rustup toolchain list) && \19RUN rustup toolchain uninstall $(rustup toolchain list) && \19 rustup toolchain install $RUST_TOOLCHAIN && \20 rustup toolchain install $RUST_TOOLCHAIN && \20 rustup default $RUST_TOOLCHAIN && \21 rustup default $RUST_TOOLCHAIN && \21 rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN22 rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN222323RUN mkdir /dev_chain && git clone $REPO_URL /dev_chain && cd /dev_chain && git checkout $BRANCH24RUN mkdir /dev_chain && git clone $REPO_URL -b $BRANCH /dev_chain24WORKDIR /dev_chain25WORKDIR /dev_chain252626RUN cargo build --release27RUN cargo build --release272828EXPOSE 984429EXPOSE 994430EXPOSE 993331EXPOSE 983332EXPOSE 4033333EXPOSE 303333435CMD cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external29CMD cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external3630.docker/Dockerfile-parachaindiffbeforeafterboth1# ===== Rust builder =====1# ===== Rust builder =====2FROM phusion/baseimage:focal-1.1.0 as rust-builder2FROM ubuntu:20.04 as rust-builder3LABEL maintainer="Unique.Network"3LABEL maintainer="Unique.Network"445ARG RUST_TOOLCHAIN=nightly-2022-05-115ARG RUST_TOOLCHAIN=nightly-2022-05-116ARG POLKA_VERSION=release-v0.9.247689ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN10ENV POLKA_VERSION $POLKA_VERSION1112ENV CARGO_HOME="/cargo-home"8ENV CARGO_HOME="/cargo-home"13ENV PATH="/cargo-home/bin:$PATH"9ENV PATH="/cargo-home/bin:$PATH"141015RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none11RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none161217RUN apt-get update && \13RUN apt-get update && \18 apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \19 apt-get install -y cmake pkg-config libssl-dev git clang && \14 apt-get install -y cmake pkg-config libssl-dev git clang && \20 apt-get clean && \15 apt-get clean && \21 rm -r /var/lib/apt/lists/*16 rm -r /var/lib/apt/lists/*28RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN23RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN2924302531RUN cargo install cargo-chef3233RUN mkdir unique_parachain26RUN mkdir unique_parachain34WORKDIR /unique_parachain27WORKDIR /unique_parachain352836# ===== Chef =====37FROM rust-builder as chef3839COPY . .40RUN cargo chef prepare --recipe-path recipe.json4142####works inside repo folder###434445# ===== BUILD ======29# ===== BUILD ======46FROM rust-builder as builder-unique30FROM rust-builder as builder-unique473132ARG PROFILE=release33ARG FEATURE=3448RUN mkdir unique_parachain35RUN mkdir unique_parachain49WORKDIR /unique_parachain36WORKDIR /unique_parachain503751COPY --from=chef /unique_parachain/recipe.json recipe.json5253RUN cargo chef cook --release --recipe-path recipe.json38RUN git clone $REPO_URL -b $BRANCH5455ARG FEATURE=' '5657COPY . .58RUN cargo build $FEATURE --release39RUN cargo build $FEATURE --$PROFILE59 # && \40 # && \60 # cargo test41 # cargo test614262# ===== BUILD POLKADOT =====43# ===== BUILD POLKADOT =====63FROM rust-builder as builder-polkadot44FROM rust-builder as builder-polkadot644546ARG POLKA_VERSION=release-v0.9.2447ENV POLKA_VERSION $POLKA_VERSION4865RUN mkdir unique_parachain49RUN mkdir unique_parachain66WORKDIR /unique_parachain50WORKDIR /unique_parachain675168RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \52RUN git clone -b $POLKA_VERSION --depth 1 https://github.com/paritytech/polkadot.git && \69 cd polkadot && \53 cd polkadot && \70 git tag -n && \54 cargo build --release71 cargo build --release725573# ===== RUN ======56# ===== RUN ======745775FROM phusion/baseimage:focal-1.1.058FROM ubuntu:20.04765977RUN apt-get -y update && \60RUN apt-get -y update && \78 apt-get -y upgrade && \61 apt-get -y upgrade && \79 apt-get -y install curl git && \62 apt-get -y install curl git && \80 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \63 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \81 export NVM_DIR="$HOME/.nvm" && \64 export NVM_DIR="$HOME/.nvm" && \82 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \65 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \83 nvm install v15.5.0 && \66 nvm install v16.16.0 && \84 nvm use v15.5.067 nvm use v16.16.0856886RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \69RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing87 cd /polkadot-launch && \88 git checkout feature/runtime-upgrade-testing897090RUN export NVM_DIR="$HOME/.nvm" && \71RUN export NVM_DIR="$HOME/.nvm" && \91 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \72 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \92 cd /polkadot-launch && \73 cd /polkadot-launch && \93 npm install --global yarn && \74 npm install --global yarn && \94 yarn75 yarn install957696COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/77COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/97COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/78COPY --from=builder-polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/987999COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"]80COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"]10010181102EXPOSE 9844103EXPOSE 9944104EXPOSE 9933105EXPOSE 9833106EXPOSE 40333107EXPOSE 3033310882109CMD export NVM_DIR="$HOME/.nvm" && \83CMD export NVM_DIR="$HOME/.nvm" && \110 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \84 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \.docker/Dockerfile-parachain-v2diffbeforeafterbothno changes
.docker/docker-compose-dev.yamldiffbeforeafterboth1version: "3.5"1version: "3.5"223services:3services:4 node-o:4 node-dev:5 build:5 build:6 context: ../6 context: ../7 dockerfile: .docker/Dockerfile-chain-dev7 dockerfile: .docker/Dockerfile-chain-dev8 image: node-o8 image: node-dev9 container_name: node-o9 container_name: node-dev10 expose:10 expose:11 - 994411 - 994412 - 993312 - 9933.docker/docker-compose-tests-parachain.ymldiffbeforeafterbothno changes
.docker/docker-compose.tmp-master.j2diffbeforeafterbothno changes
.docker/docker-compose.tmp.j2diffbeforeafterboth1version: "3.5"1version: "3.5"223services:3services:4 node-o:4 node-dev:5 build:5 build:6 args:6 args:7 - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"7 - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"8 - "BRANCH={{ BRANCH }}"8 - "BRANCH={{ BRANCH }}"9 - "REPO_URL={{ REPO_URL }}"9 - "REPO_URL={{ REPO_URL }}"10 - "FEATURE={{ FEATURE }}"10 - "FEATURE={{ FEATURE }}"11 - "POLKA_VERSION={{ POLKA_VERSION }}"1213 command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external1114.dockerignorediffbeforeafterboth1.git/1.git/2.github/2.github/3.docker/3doc/4doc/4target/5target/5tests/6tests/.github/workflows/build-test-master.ymldiffbeforeafterbothno changes
.github/workflows/codestyle.ymldiffbeforeafterboth6 - develop6 - develop7 types:7 types:8 - opened8 - opened9 - edited9 - reopened10 - synchronize101111jobs:12jobs:12 rustfmt:13 rustfmt:29 runs-on: self-hosted-ci30 runs-on: self-hosted-ci303131 steps:32 steps:32 - uses: actions/checkout@v133 - uses: actions/checkout@v333 - name: Install substrate dependencies34 - name: Install substrate dependencies34 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang35 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang35 - name: Install latest nightly36 - name: Install latest nightly.github/workflows/node_build_test.ymldiffbeforeafterboth1name: Build & test1name: Develop - Build & test223# Controls when the action will run.3# Controls when the action will run.4on:4on:5 # Triggers the workflow on push or pull request events but only for the master branch5 # Triggers the workflow on push or pull request events but only for the master branch6 #push:7 # branches: [ develop ]8 pull_request:6 pull_request:9 branches:7 branches:10 - develop8 - develop11 types:9 types:12 - opened10 - opened13 - edited11 - reopened14 - reopened12 - synchronize #commit(s) pushed to the pull request15 # pull_request:1316 # branches: [ develop ]17 # Allows you to run this workflow manually from the Actions tab14 # Allows you to run this workflow manually from the Actions tab18 workflow_dispatch:15 workflow_dispatch:191620#Define Workflow variables17#Define Workflow variables21env:18env: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-1119 RUST_TOOLCHAIN: nightly-2022-05-1128 REPO_URL: ${{ github.server_url }}/${{ github.repository }}20 REPO_URL: ${{ github.server_url }}/${{ github.repository }}21 POLKA_VERSION: release-v0.9.24292230# A workflow run is made up of one or more jobs that can run sequentially or in parallel23# A workflow run is made up of one or more jobs that can run sequentially or in parallel31jobs:24jobs: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:25 build:50 # The type of runner that the job will run on26 # The type of runner that the job will run on51 runs-on: self-hosted-ci27 runs-on: self-hosted-ci522853 needs: pre-requisites54 name: Build Container, Spin it Up an test29 name: Build Container, Spin it Up an test553056 continue-on-error: true #Do not stop testing of matrix runs failed.31 continue-on-error: false #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.573258 strategy:33 strategy:59 matrix:34 matrix:60 include:35 include:61 - network: "Opal"36 - network: "Opal"62 features: " "37 features: "--features=opal-runtime"63 - network: "Quartz"38 - network: "Quartz"64 features: "--features=quartz-runtime"39 features: "--features=quartz-runtime"65 - network: "Unique"40 - network: "Unique"66 features: "--features=unique-runtime"41 features: "--features=unique-runtime"674268 steps:43 steps:69 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it70 - uses: actions/checkout@v344 - name: Skip if pull request is in Draft7145 # `if: github.event.pull_request.draft == true` should be kept here, at46 # the step level, rather than at the job level. The latter is not47 # recommended because when the PR is moved from "Draft" to "Ready to48 # review" the workflow will immediately be passing (since it was skipped),49 # even though it hasn't actually ran, since it takes a few seconds for50 # the workflow to start. This is also disclosed in:51 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1752 # That scenario would open an opportunity for the check to be bypassed:53 # 1. Get your PR approved54 # 2. Move it to Draft55 # 3. Push whatever commits you want56 # 4. Move it to "Ready for review"; now the workflow is passing (it was57 # skipped) and "Check reviews" is also passing (it won't be updated58 # until the workflow is finished)59 if: github.event.pull_request.draft == true60 run: exit 16162 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it72 - name: Generate ENV related extend file for docker-compose63 - uses: actions/checkout@v373 uses: cuchi/jinja2-action@v1.2.074 with:64 with:75 template: .docker/docker-compose.tmp.j276 output_file: .docker/docker-compose.${{ matrix.network }}.yml77 variables: |65 ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit78 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git79 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}80 FEATURE=${{ matrix.features }}81 BRANCH=${{ github.head_ref }}826683 - name: Show temporary file67 - name: Generate ENV related extend file for docker-compose68 uses: cuchi/jinja2-action@v1.2.069 with:70 template: .docker/docker-compose.tmp.j284 run: cat .docker/docker-compose.${{ matrix.network }}.yml71 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 }}857886 - name: Build the stack79 - name: Show build configuration87 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build80 run: cat .docker/docker-compose.${{ matrix.network }}.yml8889# - 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 .918192 - name: Wait82 - name: Build the stack93 run: sleep 420s83 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build948495 - name: Install node85 - uses: actions/setup-node@v396 uses: actions/setup-node@v197 with:86 with:98 node-version: 14.x87 node-version: 1699100 - name: Install dependencies101 run: |102 cd tests103 yarn install104 yarn add mochawesome105 yarn --pure-lockfile10688107 - name: Run tests89 - name: Run tests108 run: |90 run: |109 cd tests91 cd tests110 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}92 yarn install93 yarn add mochawesome94 yarn --pure-lockfile95 echo "Ready to start tests"96 node scripts/readyness.js97 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}111 env:98 env:112 RPC_URL: http://127.0.0.1:9933/99 RPC_URL: http://127.0.0.1:9933/113100114 - name: Test Report101 - name: Test Report115 uses: phoenix-actions/test-reporting@v8102 uses: phoenix-actions/test-reporting@v8116 id: test-report # Set ID reference for step117 if: success() || failure() # run this step even if previous step failed103 if: success() || failure() # run this step even if previous step failed118 with:104 with:119 name: Tests ${{ matrix.network }} # Name of the check run which will be created105 name: Tests ${{ matrix.network }} # Name of the check run which will be created120 path: tests/mochawesome-report/test-*.json # Path to test results106 path: tests/mochawesome-report/test-*.json # Path to test results121 reporter: mochawesome-json107 reporter: mochawesome-json122 fail-on-error: 'false'108 fail-on-error: 'false'109110 - name: Read output variables111 run: |112 echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"123113124 - name: Stop running containers114 - name: Stop running containers125 if: always() # run this step always115 if: always() # run this step always.github/workflows/notify.ymldiffbeforeafterbothno changes
.github/workflows/tests_codestyle.ymldiffbeforeafterboth6 - develop6 - develop7 types:7 types:8 - opened8 - opened9 - edited9 - reopened10 - synchronize10jobs:11jobs:11 build:12 build:12 runs-on: self-hosted-ci13 runs-on: self-hosted-ci131414 steps:15 steps:15 - uses: actions/checkout@v216 - uses: actions/checkout@v317 18 - uses: actions/setup-node@v319 with:20 node-version: 162116 - name: Install modules22 - name: Install modules17 run: cd tests && yarn23 run: cd tests && yarnDockerfile-parachaindiffbeforeafterbothno changes
docker-compose-tests-parachain.ymldiffbeforeafterbothno changes
tests/scripts/readyness.jsdiffbeforeafterbothno changes