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

difftreelog

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

Alex2022-08-01parents: #2232fc1 #80975a9.patch.diff
in: master
Re-created branch with changes related to STEP1 task.

10 files changed

added.docker/Dockerfile-chain-devdiffbeforeafterboth

no changes

added.docker/Dockerfile-parachaindiffbeforeafterboth

no changes

added.docker/Dockerfile-parachain-v2diffbeforeafterboth

no changes

added.docker/docker-compose-dev.yamldiffbeforeafterboth

no changes

added.docker/docker-compose-tests-parachain.ymldiffbeforeafterboth

no changes

added.docker/docker-compose.tmp.j2diffbeforeafterboth

no changes

modified.github/workflows/codestyle.ymldiffbeforeafterboth
1name: Code style1name: Code style
22
3on: [push]3on:
4 pull_request:
5 branches:
6 - develop
7 types:
8 - opened
9 - edited
410
5jobs:11jobs:
6 rustfmt:12 rustfmt:
7 runs-on: ubuntu-20.0413 runs-on: self-hosted-ci
814
9 steps:15 steps:
10 - uses: actions/checkout@v116 - uses: actions/checkout@v1
2026
21 clippy:27 clippy:
22 if: ${{ false }}28 if: ${{ false }}
23 runs-on: ubuntu-20.0429 runs-on: self-hosted-ci
2430
25 steps:31 steps:
26 - uses: actions/checkout@v132 - uses: actions/checkout@v1
modified.github/workflows/node_build_test.ymldiffbeforeafterboth
1name: Build & test1name: 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 ]
6 push:8 pull_request:
7 branches: [ develop ]9 branches:
10 - develop
11 types:
12 - opened
13 - edited
14 - reopened
8 # pull_request:15 # pull_request:
9 # branches: [ develop ]16 # branches: [ develop ]
10 # Allows you to run this workflow manually from the Actions tab17 # Allows you to run this workflow manually from the Actions tab
11 workflow_dispatch:18 workflow_dispatch:
1219
13# A workflow run is made up of one or more jobs that can run sequentially or in parallel20#Define Workflow variables
21env:
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 src_repo_url: https://github.com/lzadjsf/unique-chain.git
28 RUST_TOOLCHAIN: nightly-2022-05-11
29 REPO_URL: ${{ github.server_url }}/${{ github.repository }}
30
31# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14jobs:32jobs:
33 pre-requisites:
34 # The type of runner that the job will run on
35 runs-on: self-hosted-ci
36
37 steps:
38 #runs ssh connection
39 - name: Install dependencies
40 run: |
41 sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake
42 sudo apt autoremove
43 curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
44 . $HOME/.cargo/env && cargo install --locked --git https://github.com/chevdor/subwasm
45 rustup toolchain install ${{ env.RUST_TOOLCHAIN }}
46 rustup default ${{ env.RUST_TOOLCHAIN }}
47 rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_TOOLCHAIN }}
48
49
15 build:50 build:
16 # The type of runner that the job will run on51 # The type of runner that the job will run on
17 runs-on: ubuntu-20.0452 runs-on: self-hosted-ci
1853
19 # if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true54 needs: pre-requisites
2055 name: Build Container, Spin it Up an test
21 # Steps represent a sequence of tasks that will be executed as part of the job56
57 continue-on-error: true #Do not stop testing of matrix runs failed.
58
59 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"
68
22 steps:69 steps:
23 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it70 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
71 - uses: actions/checkout@v3
72
73 - name: Generate ENV related extend file for docker-compose
74 uses: cuchi/jinja2-action@v1.2.0
75 with:
76 template: .docker/docker-compose.tmp.j2
77 output_file: .docker/docker-compose.${{ matrix.network }}.yml
78 variables: |
79 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
80 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
81 FEATURE=${{ matrix.features }}
82 BRANCH=${{ github.head_ref }}
83
84 - name: Show temporary file
85 run: cat .docker/docker-compose.${{ matrix.network }}.yml
86
87 - name: Build the stack
88 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build
89
90# - 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 .
92
93 - name: Wait
94 run: sleep 420s
95
24 - uses: actions/checkout@v296 - name: Install node
25 97 uses: actions/setup-node@v1
26 #runs ssh connection98 with:
99 node-version: 14.x
100
101 - name: Install dependencies
102 run: |
103 cd tests
104 yarn install
105 yarn add mochawesome
106 yarn --pure-lockfile
107
108 - name: Run tests
109 run: |
110 cd tests
111 ./scripts/ci-check-docker-state.sh
112 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
113 env:
114 RPC_URL: http://127.0.0.1:9933/
115
27 - name: Go to server116 - name: Test Report
28 uses: appleboy/ssh-action@master117 uses: phoenix-actions/test-reporting@v8
29 with:118 id: test-report # Set ID reference for step
30 host: ${{ secrets.SERVER_IP }}119 if: success() || failure() # run this step even if previous step failed
31 username: ${{ secrets.SERVER_USERNAME }}120 with:
32 key: ${{ secrets.KEY }}121 name: Tests ${{ matrix.network }} # Name of the check run which will be created
33 port: ${{ secrets.SERVER_PORT }}122 path: tests/mochawesome-report/test-*.json # Path to test results
34 command_timeout: 300m123 reporter: mochawesome-json
35 script: |124 fail-on-error: 'false'
36 eval $(ssh-agent -s)125
37 ssh-add /home/devops/.ssh/git_hub126 - name: Stop running containers
38 git clone git@github.com:UniqueNetwork/unique-chain.git127 if: always() # run this step always
39 cd unique-chain128 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
40 git checkout develop
41 # git pull --all
42 chmod +x ci_node.sh
43 ./ci_node.sh
44 rm -rf /home/polkadot/unique-chain
45129
modified.github/workflows/notify.ymldiffbeforeafterboth
1name: telegram message1name: telegram message
2on:2on:
3 push:3 pull_request:
4 branches: [ develop ] 4 branches:
5 - develop
6 types:
7 - opened
8 - edited
5jobs:9jobs:
6 build: 10 build:
7 runs-on: ubuntu-latest 11 runs-on: self-hosted-ci
8 steps: 12 steps:
9 - uses: avkviring/telegram-github-action@v0.0.1313 - uses: avkviring/telegram-github-action@v0.0.13
10 env:14 env:
modified.github/workflows/tests_codestyle.ymldiffbeforeafterboth
1name: Tests code style1name: Tests code style
22
3on: [push]3on:
44 pull_request:
5 branches:
6 - develop
7 types:
8 - opened
9 - edited
5jobs:10jobs:
6 build:11 build:
7 runs-on: ubuntu-20.0412 runs-on: self-hosted-ci
813
9 steps:14 steps:
10 - uses: actions/checkout@v215 - uses: actions/checkout@v2