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

difftreelog

Merge pull request #15 from lzadjsf/ci-build-workflow-v3

Alex2022-08-04parents: #19daf00 #f946586.patch.diff
in: master
Removed un-needed artefacts. Added additional build ARGS.

17 files changed

deleted.docker/.envdiffbeforeafterboth

no changes

modified.docker/Dockerfile-chain-devdiffbeforeafterboth
1010
11RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none11RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
1212
13ARG RUST_TOOLCHAIN=nightly-2022-04-0713ARG RUST_TOOLCHAIN=nightly-2022-05-11
14ARG BRANCH=develop14ARG POLKA_VERSION=release-v0.9.24
15ARG BRANCH=
15ARG REPO_URL=https://github.com/UniqueNetwork/unique-chain.git16ARG REPO_URL=
16ARG FEATURE=17ARG FEATURE=
1718
18RUN 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_TOOLCHAIN
2223
23RUN 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_chain
24WORKDIR /dev_chain25WORKDIR /dev_chain
2526
26RUN cargo build --release27RUN cargo build --release
2728
28EXPOSE 9844
29EXPOSE 9944
30EXPOSE 9933
31EXPOSE 9833
32EXPOSE 40333
33EXPOSE 30333
34
35CMD 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-external
3630
modified.docker/Dockerfile-parachaindiffbeforeafterboth
1# ===== Rust builder =====1# ===== Rust builder =====
2FROM phusion/baseimage:focal-1.1.0 as rust-builder2FROM ubuntu:20.04 as rust-builder
3LABEL maintainer="Unique.Network"3LABEL maintainer="Unique.Network"
44
5ARG RUST_TOOLCHAIN=nightly-2022-05-115ARG RUST_TOOLCHAIN=nightly-2022-05-11
6ARG POLKA_VERSION=release-v0.9.24
76
8
9ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN7ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN
10ENV POLKA_VERSION $POLKA_VERSION
11
12ENV CARGO_HOME="/cargo-home"8ENV CARGO_HOME="/cargo-home"
13ENV PATH="/cargo-home/bin:$PATH"9ENV PATH="/cargo-home/bin:$PATH"
1410
15RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none11RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
1612
17RUN 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_TOOLCHAIN
2924
3025
31RUN cargo install cargo-chef
32
33RUN mkdir unique_parachain26RUN mkdir unique_parachain
34WORKDIR /unique_parachain27WORKDIR /unique_parachain
3528
36# ===== Chef =====
37FROM rust-builder as chef
38
39COPY . .
40RUN cargo chef prepare --recipe-path recipe.json
41
42####works inside repo folder###
43
44
45# ===== BUILD ======29# ===== BUILD ======
46FROM rust-builder as builder-unique30FROM rust-builder as builder-unique
4731
32ARG PROFILE=release
33ARG FEATURE=
34
48RUN mkdir unique_parachain35RUN mkdir unique_parachain
49WORKDIR /unique_parachain36WORKDIR /unique_parachain
5037
51COPY --from=chef /unique_parachain/recipe.json recipe.json
52
53RUN cargo chef cook --release --recipe-path recipe.json38RUN git clone $REPO_URL -b $BRANCH
54
55ARG FEATURE=' '
56
57COPY . .
58RUN cargo build $FEATURE --release39RUN cargo build $FEATURE --$PROFILE
59 # && \40 # && \
60 # cargo test41 # cargo test
6142
62# ===== BUILD POLKADOT =====43# ===== BUILD POLKADOT =====
63FROM rust-builder as builder-polkadot44FROM rust-builder as builder-polkadot
6445
46ARG POLKA_VERSION=release-v0.9.24
47ENV POLKA_VERSION $POLKA_VERSION
48
65RUN mkdir unique_parachain49RUN mkdir unique_parachain
66WORKDIR /unique_parachain50WORKDIR /unique_parachain
6751
68RUN 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 --release
71 cargo build --release
7255
73# ===== RUN ======56# ===== RUN ======
7457
75FROM phusion/baseimage:focal-1.1.058FROM ubuntu:20.04
7659
77RUN 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.0
8568
86RUN git clone https://github.com/UniqueNetwork/polkadot-launch.git && \69RUN git clone https://github.com/uniquenetwork/polkadot-launch -b feature/runtime-upgrade-testing
87 cd /polkadot-launch && \
88 git checkout feature/runtime-upgrade-testing
8970
90RUN 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 install
9576
96COPY --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/
9879
99COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"]80COPY ["./launch-config.json", "/polkadot-launch/launch-config.json"]
100
10181
102EXPOSE 9844
103EXPOSE 9944
104EXPOSE 9933
105EXPOSE 9833
106EXPOSE 40333
107EXPOSE 30333
10882
109CMD 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" && \
deleted.docker/Dockerfile-parachain-v2diffbeforeafterboth

no changes

modified.docker/docker-compose-dev.yamldiffbeforeafterboth
1version: "3.5"1version: "3.5"
22
3services: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-dev
8 image: node-o8 image: node-dev
9 container_name: node-o9 container_name: node-dev
10 expose:10 expose:
11 - 994411 - 9944
12 - 993312 - 9933
deleted.docker/docker-compose-tests-parachain.ymldiffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-master.j2diffbeforeafterboth

no changes

modified.docker/docker-compose.tmp.j2diffbeforeafterboth
1version: "3.5"1version: "3.5"
22
3services: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 }}"
12
13 command: cargo run --release $FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
1114
modified.dockerignorediffbeforeafterboth
1.git/1.git/
2.github/2.github/
3.docker/
3doc/4doc/
4target/5target/
5tests/6tests/
deleted.github/workflows/build-test-master.ymldiffbeforeafterboth

no changes

modified.github/workflows/codestyle.ymldiffbeforeafterboth
6 - develop6 - develop
7 types:7 types:
8 - opened8 - opened
9 - edited9 - reopened
10 - synchronize
1011
11jobs:12jobs:
12 rustfmt:13 rustfmt:
29 runs-on: self-hosted-ci30 runs-on: self-hosted-ci
3031
31 steps:32 steps:
32 - uses: actions/checkout@v133 - uses: actions/checkout@v3
33 - name: Install substrate dependencies34 - name: Install substrate dependencies
34 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang35 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang
35 - name: Install latest nightly36 - name: Install latest nightly
modified.github/workflows/node_build_test.ymldiffbeforeafterboth
1name: Build & test1name: Develop - Build & test
22
3# 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 branch
6 #push:
7 # branches: [ develop ]
8 pull_request:6 pull_request:
9 branches:7 branches:
10 - develop8 - develop
11 types:9 types:
12 - opened10 - opened
13 - edited11 - reopened
14 - reopened12 - synchronize #commit(s) pushed to the pull request
15 # pull_request:13
16 # branches: [ develop ]
17 # Allows you to run this workflow manually from the Actions tab14 # Allows you to run this workflow manually from the Actions tab
18 workflow_dispatch:15 workflow_dispatch:
1916
20#Define Workflow variables17#Define Workflow variables
21env:18env:
22 ubuntu_version: focal
23 chains_release_dir: /opt/runner/chains_release
24 opal_chain_workdir: ./src_opal_chain
25 quartz_chain_workdir: ./src_quartz_chain
26 unique_chain_workdir: ./src_unique_chain
27 RUST_TOOLCHAIN: nightly-2022-05-1119 RUST_TOOLCHAIN: nightly-2022-05-11
28 REPO_URL: ${{ github.server_url }}/${{ github.repository }}20 REPO_URL: ${{ github.server_url }}/${{ github.repository }}
21 POLKA_VERSION: release-v0.9.24
2922
30# 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 parallel
31jobs:24jobs:
32 pre-requisites:
33 # The type of runner that the job will run on
34 runs-on: self-hosted-ci
35
36 steps:
37 #runs ssh connection
38 - name: Install dependencies
39 run: |
40 sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake
41 sudo apt autoremove
42 curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
43 . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm
44 rustup toolchain install ${{ env.RUST_TOOLCHAIN }}
45 rustup default ${{ env.RUST_TOOLCHAIN }}
46 rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }}
47
48
49 build:25 build:
50 # The type of runner that the job will run on26 # The type of runner that the job will run on
51 runs-on: self-hosted-ci27 runs-on: self-hosted-ci
5228
53 needs: pre-requisites
54 name: Build Container, Spin it Up an test29 name: Build Container, Spin it Up an test
5530
56 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.
5732
58 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"
6742
68 steps:43 steps:
69 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
70 - uses: actions/checkout@v344 - name: Skip if pull request is in Draft
7145 # `if: github.event.pull_request.draft == true` should be kept here, at
46 # the step level, rather than at the job level. The latter is not
47 # recommended because when the PR is moved from "Draft" to "Ready to
48 # 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 for
50 # the workflow to start. This is also disclosed in:
51 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17
52 # That scenario would open an opportunity for the check to be bypassed:
53 # 1. Get your PR approved
54 # 2. Move it to Draft
55 # 3. Push whatever commits you want
56 # 4. Move it to "Ready for review"; now the workflow is passing (it was
57 # skipped) and "Check reviews" is also passing (it won't be updated
58 # until the workflow is finished)
59 if: github.event.pull_request.draft == true
60 run: exit 1
61
62 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
72 - name: Generate ENV related extend file for docker-compose63 - uses: actions/checkout@v3
73 uses: cuchi/jinja2-action@v1.2.0
74 with:64 with:
75 template: .docker/docker-compose.tmp.j2
76 output_file: .docker/docker-compose.${{ matrix.network }}.yml
77 variables: |65 ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit
78 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
79 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
80 FEATURE=${{ matrix.features }}
81 BRANCH=${{ github.head_ref }}
8266
83 - name: Show temporary file67 - name: Generate ENV related extend file for docker-compose
68 uses: cuchi/jinja2-action@v1.2.0
69 with:
70 template: .docker/docker-compose.tmp.j2
84 run: cat .docker/docker-compose.${{ matrix.network }}.yml71 output_file: .docker/docker-compose.${{ matrix.network }}.yml
72 variables: |
73 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
74 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
75 POLKA_VERSION=${{ env.POLKA_VERSION }}
76 FEATURE=${{ matrix.features }}
77 BRANCH=${{ github.head_ref }}
8578
86 - name: Build the stack79 - name: Show build configuration
87 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 }}.yml
88
89# - 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 .
9181
92 - name: Wait82 - name: Build the stack
93 run: sleep 420s83 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build
9484
95 - name: Install node85 - uses: actions/setup-node@v3
96 uses: actions/setup-node@v1
97 with:86 with:
98 node-version: 14.x87 node-version: 16
99
100 - name: Install dependencies
101 run: |
102 cd tests
103 yarn install
104 yarn add mochawesome
105 yarn --pure-lockfile
10688
107 - name: Run tests89 - name: Run tests
108 run: |90 run: |
109 cd tests91 cd tests
110 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}92 yarn install
93 yarn add mochawesome
94 yarn --pure-lockfile
95 echo "Ready to start tests"
96 node scripts/readyness.js
97 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/
113100
114 - name: Test Report101 - name: Test Report
115 uses: phoenix-actions/test-reporting@v8102 uses: phoenix-actions/test-reporting@v8
116 id: test-report # Set ID reference for step
117 if: success() || failure() # run this step even if previous step failed103 if: success() || failure() # run this step even if previous step failed
118 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 created
120 path: tests/mochawesome-report/test-*.json # Path to test results106 path: tests/mochawesome-report/test-*.json # Path to test results
121 reporter: mochawesome-json107 reporter: mochawesome-json
122 fail-on-error: 'false'108 fail-on-error: 'false'
109
110 - name: Read output variables
111 run: |
112 echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}"
123113
124 - name: Stop running containers114 - name: Stop running containers
125 if: always() # run this step always115 if: always() # run this step always
deleted.github/workflows/notify.ymldiffbeforeafterboth

no changes

modified.github/workflows/tests_codestyle.ymldiffbeforeafterboth
6 - develop6 - develop
7 types:7 types:
8 - opened8 - opened
9 - edited9 - reopened
10 - synchronize
10jobs:11jobs:
11 build:12 build:
12 runs-on: self-hosted-ci13 runs-on: self-hosted-ci
1314
14 steps:15 steps:
15 - uses: actions/checkout@v216 - uses: actions/checkout@v3
17
18 - uses: actions/setup-node@v3
19 with:
20 node-version: 16
21
16 - name: Install modules22 - name: Install modules
17 run: cd tests && yarn23 run: cd tests && yarn
deletedDockerfile-parachaindiffbeforeafterboth

no changes

deleteddocker-compose-tests-parachain.ymldiffbeforeafterboth

no changes

addedtests/scripts/readyness.jsdiffbeforeafterboth

no changes