-
Notifications
You must be signed in to change notification settings - Fork 32
136 lines (121 loc) · 4.84 KB
/
brand-new-chain-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Brand new chain test
# This workflow is triggered on dev branch manually or automatically after the Build and Publish workflow is completed
on:
# workflow_dispatch:
# workflow_run:
# workflows: [Pull Request Check]
# types: [completed]
# branches: [dev]
pull_request:
types:
- opened
- synchronize
- closed
jobs:
brand-new-test:
runs-on: ubuntu-20.04
steps:
- name: Clone simple CI
uses: GuillaumeFalourd/[email protected]
with:
branch: main
owner: sfffaaa
repository: simple-ci-poc
- name: Clone peaq-bc-repo
uses: GuillaumeFalourd/[email protected]
with:
depth: 1
branch: main # Should change the branch
owner: peaqnetwork
repository: peaq-bc-test
- name: Clone parachain-launch
uses: GuillaumeFalourd/[email protected]
with:
branch: dev # Should change the branch
owner: peaqnetwork
repository: parachain-launch
- name: Move to project to correct place
run: |
mv simple-ci-poc ../
mv peaq-bc-test ../
mv parachain-launch ../
- name: Setup ENV for the simple CI
working-directory: ../
run: |
mkdir -p result
pwd
ls .
# Need to implement that
echo "WORK_DIRECTORY=$(pwd)" >> $GITHUB_ENV
echo "PEAQ_NETWORK_NODE_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "PEAQ_BC_TEST_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "PARACHAIN_LAUNCH_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "RESULT_PATH=$(realpath result)" >> $GITHUB_ENV
cat $GITHUB_ENV
# echo "FORKED_BINARY_FOLDER=(realpath ../forked-binary)" >> $GITHUB_ENV
- name: Install dependencies bianry
working-directory: ../
shell: bash
run: |
# Install git, default install
git --version
# Install docker, default install
docker --version
# Install docker-compose, default install?
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-compose-plugin
alias docker-compose='docker compose'
docker compose version
# Install nvm
# Already installed
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install v16
nvm use v16
# Install yarn
npm install --global yarn
# Install jq
sudo apt-get install jq
# # Install try-runtime, in this test, we won't use that
# cargo install --git https://github.com/paritytech/try-runtime-cli --locked
# # Install subkey, in this test, we won't use that
# cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked
- name: Install dependency on peaq-bc-test
working-directory: ../peaq-bc-test
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install dependency on parachain-launch
working-directory: ../parachain-launch
run: |
git submodule update --init --recursive
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm use v16
yarn install
yarn build
- name: Install dependency on fork-off-substrate
working-directory: ../parachain-launch/fork-off-substrate
run: |
npm install
- name: Run simple CI
working-directory: ../simple-ci-poc
run: |
DATETIME=$(date '+%Y-%m-%d-%H-%M')
echo "Current DateTime: ${DATETIME}"
export SET_DATETIME=${DATETIME}
# [TODO] Use the docker image to regenerate the docker image...
# Need to check several things
bash -x new.chain.test.bash --chain peaq --test all