git.delta.rocks / unique-network / refs/commits / 5de8270bcd75

difftreelog

Merge pull request #913 from UniqueNetwork/ci-ref-v3

Yaroslav Bolyukin2023-04-12parents: #4acc79c #0ca6b86.patch.diff
in: master
CI ref v3

30 files changed

deleted.docker/Dockerfile-parachain-upgradediffbeforeafterboth

no changes

deleted.docker/Dockerfile-parachain-upgrade-datadiffbeforeafterboth

no changes

added.docker/Dockerfile-parachain-upgrade-data.j2diffbeforeafterboth

no changes

added.docker/Dockerfile-parachain-upgrade.j2diffbeforeafterboth

no changes

deleted.docker/Dockerfile-try-runtimediffbeforeafterboth

no changes

added.docker/Dockerfile-try-runtime.j2diffbeforeafterboth

no changes

added.docker/docker-compose.forkless-data.j2diffbeforeafterboth

no changes

added.docker/docker-compose.forkless-nodata.j2diffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-forkless-data.j2diffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-forkless-nodata.j2diffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-try-runtime.j2diffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-xcm-tests.j2diffbeforeafterboth

no changes

added.docker/docker-compose.try-runtime.j2diffbeforeafterboth

no changes

added.docker/docker-compose.xcm.j2diffbeforeafterboth

no changes

added.github/actions/prepare/action.ymldiffbeforeafterboth

no changes

modified.github/workflows/ci-develop.ymldiffbeforeafterboth
19 yarn-dev:19 yarn-dev:
20 if: github.event.pull_request.draft == false # Conditional check for draft per job.20 if: github.event.pull_request.draft == false # Conditional check for draft per job.
21 uses: ./.github/workflows/yarn-dev.yml21 uses: ./.github/workflows/yarn-dev.yml
22 secrets: inherit
2223
23 unit-test:24 unit-test:
24 if: github.event.pull_request.draft == false # Conditional check for draft per job.25 if: github.event.pull_request.draft == false # Conditional check for draft per job.
25 uses: ./.github/workflows/unit-test.yml26 uses: ./.github/workflows/unit-test.yml
27 secrets: inherit
2628
27 canary:29 canary:
28 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'canary')) }} # Conditional check for draft & labels per job.30 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-canary')) }} # Conditional check for draft & labels per job.
29 uses: ./.github/workflows/canary.yml31 uses: ./.github/workflows/canary.yml
30 secrets: inherit # pass all secrets from initial workflow to nested32 secrets: inherit # pass all secrets from initial workflow to nested
3133
32 xcm:34 xcm:
33 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'xcm')) }} # Conditional check for draft & labels per job.35 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-xcm')) }} # Conditional check for draft & labels per job.
34 uses: ./.github/workflows/xcm.yml36 uses: ./.github/workflows/xcm.yml
35 secrets: inherit # pass all secrets from initial workflow to nested37 secrets: inherit # pass all secrets from initial workflow to nested
36 38
37 collator-selection:39 collator-selection:
38 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-collator-selection')) }} # Conditional check for draft & labels per job.40 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-collator-selection')) }} # Conditional check for draft & labels per job.
39 uses: ./.github/workflows/collator-selection.yml41 uses: ./.github/workflows/collator-selection.yml
40 42 secrets: inherit
43
44 # forkless:
45 # if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job.
46 # uses: ./.github/workflows/forkless.yml
47 # secrets: inherit
48
49 forkless-update-data:
50 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job.
51 uses: ./.github/workflows/forkless-update-data.yml
52 secrets: inherit # pass all secrets from initial workflow to nested
53
41 forkless:54 forkless-update-no-data:
42 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'forkless')) }} # Conditional check for draft & labels per job.55 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job.
43 uses: ./.github/workflows/forkless.yml56 uses: ./.github/workflows/forkless-update-nodata.yml
44 57 secrets: inherit # pass all secrets from initial workflow to nested
58
59 try-runtime:
60 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-forkless')) }} # Conditional check for draft & labels per job.
61 uses: ./.github/workflows/try-runtime.yml
62 secrets: inherit # pass all secrets from initial workflow to nested
63
45 node-only-update:64 node-only-update:
46 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'node-only-update')) }} # Conditional check for draft & labels per job.65 if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'CI-node-only-update')) }} # Conditional check for draft & labels per job.
47 uses: ./.github/workflows/node-only-update.yml66 uses: ./.github/workflows/node-only-update.yml
48 67 secrets: inherit
49 # integration:
50 # if: ${{ (github.event.pull_request.draft == false && contains( github.event.pull_request.labels.*.name, 'integration')) }} # Conditional check for draft & labels per job.
51 # uses: ./.github/workflows/integration-tests.yml
5268
53 codestyle:69 codestyle:
54 if: github.event.pull_request.draft == false # Conditional check for draft per job.70 if: github.event.pull_request.draft == false # Conditional check for draft per job.
55 uses: ./.github/workflows/codestyle.yml71 uses: ./.github/workflows/codestyle.yml
5672 secrets: inherit
modified.github/workflows/codestyle.ymldiffbeforeafterboth
13 steps:13 steps:
14 - name: Clean Workspace14 - name: Clean Workspace
15 uses: AutoModality/action-clean@v1.1.015 uses: AutoModality/action-clean@v1.1.0
16 - uses: actions/checkout@v316 - uses: actions/checkout@v3.1.0
17 with:17 with:
18 ref: ${{ github.head_ref }} 18 ref: ${{ github.head_ref }}
19 - name: Install latest nightly19 - name: Install latest nightly
20 uses: actions-rs/toolchain@v120 uses: dtolnay/rust-toolchain@nightly
21 with:21 with:
22 toolchain: nightly
23 default: true
24 target: wasm32-unknown-unknown22 targets: wasm32-unknown-unknown
25 components: rustfmt, clippy23 components: rustfmt, clippy
26 - name: Run cargo fmt24 - name: Run cargo fmt
27 run: cargo fmt -- --check # In that mode it returns only exit code.25 run: cargo fmt -- --check # In that mode it returns only exit code.
34 steps:32 steps:
35 - name: Clean Workspace33 - name: Clean Workspace
36 uses: AutoModality/action-clean@v1.1.034 uses: AutoModality/action-clean@v1.1.0
37 - uses: actions/checkout@v335 - uses: actions/checkout@v3.1.0
38 with:36 with:
39 ref: ${{ github.head_ref }} 37 ref: ${{ github.head_ref }}
40 - uses: actions/setup-node@v338 - uses: actions/setup-node@v3.5.1
41 with:39 with:
42 node-version: 1640 node-version: 16
43 - name: Install modules41 - name: Install modules
49 if: ${{ false }}47 if: ${{ false }}
50 runs-on: [ self-hosted-ci ]48 runs-on: [ self-hosted-ci ]
51 steps:49 steps:
52 - uses: actions/checkout@v350 - uses: actions/checkout@v3.1.0
53 - name: Install substrate dependencies51 - name: Install substrate dependencies
54 run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler52 run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler
55 - name: Install latest nightly53 - name: Install latest nightly
56 uses: actions-rs/toolchain@v154 uses: dtolnay/rust-toolchain@nightly
57 with:55 with:
58 toolchain: nightly
59 default: true
60 target: wasm32-unknown-unknown56 targets: wasm32-unknown-unknown
61 components: rustfmt, clippy57 components: rustfmt, clippy
62 - name: Run cargo check58 - name: Run cargo check
63 run: cargo clippy -- -Dwarnings59 run: cargo clippy -- -Dwarnings
modified.github/workflows/execution-matrix.ymldiffbeforeafterboth
24 uses: AutoModality/action-clean@v1.1.024 uses: AutoModality/action-clean@v1.1.0
2525
26 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it26 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27 - uses: actions/checkout@v327 - uses: actions/checkout@v3.1.0
28 with:28 with:
29 ref: ${{ github.head_ref }} #Checking out head commit29 ref: ${{ github.head_ref }} #Checking out head commit
3030
31 - name: Read .env file31 - name: Read .env file
32 uses: xom9ikk/dotenv@v232 uses: xom9ikk/dotenv@v2
3333
34 - name: Create Execution matrix34 - name: Create Execution matrix
35 uses: CertainLach/create-matrix-action@v335 uses: CertainLach/create-matrix-action@v4
36 id: create_matrix36 id: create_matrix
37 with:37 with:
38 matrix: |38 matrix: |
modified.github/workflows/forkless-update-data.ymldiffbeforeafterboth
9# A workflow run is made up of one or more jobs that can run sequentially or in parallel9# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10jobs:10jobs:
1111
12 execution-marix:12 prepare-execution-marix:
1313
14 name: Prepare execution matrix14 name: Prepare execution matrix
1515
23 uses: AutoModality/action-clean@v1.1.023 uses: AutoModality/action-clean@v1.1.0
2424
25 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it25 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26 - uses: actions/checkout@v326 - uses: actions/checkout@v3.1.0
27 with:27 with:
28 ref: ${{ github.head_ref }} #Checking out head commit28 ref: ${{ github.head_ref }} #Checking out head commit
2929
30 - name: Read .env file30 - name: Read .env file
31 uses: xom9ikk/dotenv@v231 uses: xom9ikk/dotenv@v2
3232
33 - name: Create Execution matrix33 - name: Create Execution matrix
34 uses: CertainLach/create-matrix-action@v334 uses: CertainLach/create-matrix-action@v4
35 id: create_matrix35 id: create_matrix
36 with:36 with:
37 matrix: |37 matrix: |
40 network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}40 network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
41 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}41 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}
42
43 forkless-data-build:
44 needs: prepare-execution-marix
45 # The type of runner that the job will run on
46 runs-on: [self-hosted-ci,large]
47 timeout-minutes: 1380
48
49 name: ${{ matrix.network }}-data-build
50 strategy:
51 matrix:
52 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
53
54 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
55
56 steps:
57 - name: Clean Workspace
58 uses: AutoModality/action-clean@v1.1.0
59
60 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
61 - uses: actions/checkout@v3.1.0
62 with:
63 ref: ${{ github.head_ref }} #Checking out head commit
64
65 - name: Read .env file
66 uses: xom9ikk/dotenv@v2
67
68 # Prepare SHA
69 - name: Prepare SHA
70 uses: ./.github/actions/prepare
71
72 # Build main image for FORKLESS-UPDATE-NODATA
73 - name: Generate ENV related extend Dockerfile file
74 uses: cuchi/jinja2-action@v1.2.0
75 with:
76 template: .docker/Dockerfile-parachain-upgrade-data.j2
77 output_file: .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml
78 variables: |
79 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
80 NETWORK=${{ matrix.network }}
81 MAINNET_BRANCH=${{ matrix.mainnet_branch }}
82 WASM_NAME=${{ matrix.wasm_name }}
83 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
84 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
85 REPLICA_FROM=${{ matrix.replica_from_address }}
86
87 - name: Show build configuration
88 run: cat .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml
89
90 - name: Generate launch-config-forkless-data.json
91 uses: cuchi/jinja2-action@v1.2.0
92 with:
93 template: .docker/forkless-config/launch-config-forkless-data.j2
94 output_file: .docker/forkless-config/launch-config-forkless-data.json
95 variables: |
96 WASM_NAME=${{ matrix.wasm_name }}
97 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}
98 REPLICA_FROM=${{ matrix.replica_from_address }}
99
100 - name: Show launch-config-forkless configuration
101 run: cat .docker/forkless-config/launch-config-forkless-data.json
102
103 - name: Run find-and-replace to remove slashes from branch name
104 uses: mad9000/actions-find-and-replace-string@4
105 id: branchname
106 with:
107 source: ${{ github.head_ref }}
108 find: '/'
109 replace: '-'
110
111 - name: Set build SHA
112 shell: bash
113 run: |
114 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
115
116 - name: Build the stack
117 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../
118
119 - name: Log in to Docker Hub
120 uses: docker/login-action@v2.1.0
121 with:
122 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
123 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
124
125 - name: Push docker image version
126 run: docker push uniquenetwork/ci-forkless-data-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA
127
128 - name: Remove builder cache
129 if: always() # run this step always
130 run: |
131 docker builder prune -f
132 docker system prune -f
42133
43 forkless-update-data:134 forkless-data-tests:
44 needs: execution-marix135 needs: [prepare-execution-marix, forkless-data-build]
45 # The type of runner that the job will run on136 # The type of runner that the job will run on
46 runs-on: [self-hosted-ci,large]137 runs-on: [self-hosted-ci, large]
138
47 timeout-minutes: 1380139 timeout-minutes: 600
48140
49 name: ${{ matrix.network }}-data141 name: ${{ matrix.network }}-data-tests
142
143 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
144
50 strategy:145 strategy:
51 matrix:146 matrix:
52 include: ${{fromJson(needs.execution-marix.outputs.matrix)}}147 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
53
54 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
55148
56 steps:149 steps:
150 - name: Skip if pull request is in Draft
151 if: github.event.pull_request.draft == true
152 run: exit 1
153
57 - name: Clean Workspace154 - name: Clean Workspace
58 uses: AutoModality/action-clean@v1.1.0155 uses: AutoModality/action-clean@v1.1.0
59156
60 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it157 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
61 - uses: actions/checkout@v3158 - uses: actions/checkout@v3.1.0
62 with:159 with:
63 ref: ${{ github.head_ref }} #Checking out head commit160 ref: ${{ github.head_ref }} #Checking out head commit
161
162 - name: Prepare
163 uses: ./.github/actions/prepare
164
165 - name: Set build SHA
166 shell: bash
167 run: |
168 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
169
170 - name: Run find-and-replace to remove slashes from branch name
171 uses: mad9000/actions-find-and-replace-string@4
172 id: branchname
173 with:
174 source: ${{ github.head_ref }}
175 find: '/'
176 replace: '-'
64177
65 - name: Read .env file178 - name: Read .env file
66 uses: xom9ikk/dotenv@v2179 uses: xom9ikk/dotenv@v2
67180
68 - name: Generate ENV related extend file for docker-compose181 - name: Generate ENV related extend file for docker-compose
69 uses: cuchi/jinja2-action@v1.2.0182 uses: cuchi/jinja2-action@v1.2.0
70 with:183 with:
71 template: .docker/docker-compose.tmp-forkless-data.j2184 template: .docker/docker-compose.forkless-data.j2
72 output_file: .docker/docker-compose-forkless-data.${{ matrix.network }}.yml185 output_file: .docker/docker-compose.forkless-data.${{ matrix.network }}.yml
73 variables: |186 variables: |
74 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git187 NETWORK=${{ matrix.network }}
75 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}188 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA
76 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
77 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
78 # POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}
79 # MAINNET_TAG=${{ matrix.mainnet_tag }}
80 MAINNET_BRANCH=${{ matrix.mainnet_branch }}
81 NETWORK=${{ matrix.network }}
82 # BRANCH=${{ github.head_ref }}
83 REPLICA_FROM=${{ matrix.replica_from_address }}
84 WASM_NAME=${{ matrix.wasm_name }}
85189
86 - name: Show build configuration190 - name: Show build configuration
87 run: cat .docker/docker-compose-forkless-data.${{ matrix.network }}.yml191 run: cat .docker/docker-compose.forkless-data.${{ matrix.network }}.yml
88192
89 - name: Generate launch-config-forkless-data.json193 - name: Log in to Docker Hub
90 uses: cuchi/jinja2-action@v1.2.0194 uses: docker/login-action@v2.1.0
91 with:195 with:
92 template: .docker/forkless-config/launch-config-forkless-data.j2196 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
93 output_file: .docker/launch-config-forkless-data.json
94 variables: |197 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
95 NETWORK=${{ matrix.network }}
96 REPLICA_FROM=${{ matrix.replica_from_address }}
97 WASM_NAME=${{ matrix.wasm_name}}
98 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}
99198
100 - name: Show launch-config-forkless configuration199 - name: Build the stack
101 run: cat .docker/launch-config-forkless-data.json200 run: docker-compose -f ".docker/docker-compose.forkless-data.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
102201
103 - name: Build the stack202 - uses: actions/setup-node@v3.5.1
203 with:
104 run: docker-compose -f ".docker/docker-compose-forkless-data.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300204 node-version: 16
105205
106 - name: Check if docker logs consist logs related to Runtime Upgrade testing.206 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
107 if: success()207 if: success()
108 run: |208 run: |
109 counter=160209 counter=160
110 function check_container_status {210 function check_container_status {
111 docker inspect -f {{.State.Running}} node-parachain211 docker inspect -f {{.State.Running}} forkless-data
112 }212 }
113 function do_docker_logs {213 function do_docker_logs {
114 docker logs --details node-parachain 2>&1214 docker logs --details forkless-data 2>&1
115 }215 }
116 function is_started {216 function is_started {
117 if [ "$(check_container_status)" == "true" ]; then217 if [ "$(check_container_status)" == "true" ]; then
118 echo "Container: node-parachain RUNNING";218 echo "Container: forkless-data RUNNING";
119 echo "Check Docker logs"219 echo "Check Docker logs"
120 DOCKER_LOGS=$(do_docker_logs)220 DOCKER_LOGS=$(do_docker_logs)
121 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then221 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
122 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"222 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
123 return 0223 return 0
124 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then224 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then
125 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"225 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"
126 return 1226 return 1
127 else227 else
128 echo "Message not found in logs output, repeating..."228 echo "Message not found in logs output, repeating..."
129 return 1229 return 1
130 fi230 fi
131 else231 else
132 echo "Container node-parachain not RUNNING"232 echo "Container forkless-data not RUNNING"
133 echo "Halting all future checks"233 echo "Halting all future checks"
134 exit 1234 exit 1
135 fi235 fi
136 exit 0236 exit 0
137 }237 }
138 while ! is_started; do238 while ! is_started; do
139 echo "Waiting for special message in log files "239 echo "Waiting for special message in log files "
140 sleep 30s240 sleep 30s
141 counter=$(( $counter - 1 ))241 counter=$(( $counter - 1 ))
142 echo "Counter: $counter"242 echo "Counter: $counter"
143 if [ "$counter" -gt "0" ]; then243 if [ "$counter" -gt "0" ]; then
144 continue244 continue
145 else245 else
146 break246 break
147 fi247 fi
148 done248 done
149 echo "Halting script"249 echo "Halting script"
150 exit 0250 exit 0
151 shell: bash251 shell: bash
152252
153 - name: Collect Docker Logs253 - name: Collect Docker Logs
154 if: success() || failure()254 if: success() || failure()
155 uses: jwalton/gh-docker-logs@v2.2.0255 uses: jwalton/gh-docker-logs@v2.2.1
156 with:256 with:
157 dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}'257 dest: './forkless-parachain-upgrade-data-logs.${{ matrix.features }}'
158 images: 'node-parachain'
159258
160 - name: Show Docker logs259 - name: Show Docker logs
161 if: success() || failure()260 if: success() || failure()
162 run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/node-parachain.log'261 run: cat './forkless-parachain-upgrade-data-logs.${{ matrix.features }}/forkless-data.log'
163262
164 - name: Stop running containers263 - name: Stop running containers
165 if: always() # run this step always264 if: always() # run this step always
166 run: docker-compose -f ".docker/docker-compose-forkless-data.${{ matrix.network }}.yml" down --volumes265 run: docker-compose -f ".docker/docker-compose.forkless-data.${{ matrix.network }}.yml" down --volumes
167266
168 - name: Remove builder cache267 - name: Remove builder cache
169 if: always() # run this step always268 if: always() # run this step always
modified.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth
88
9# A workflow run is made up of one or more jobs that can run sequentially or in parallel9# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10jobs:10jobs:
11 execution-marix:11 prepare-execution-marix:
1212
13 name: Prepare execution matrix13 name: Prepare execution matrix
1414
22 uses: AutoModality/action-clean@v1.1.022 uses: AutoModality/action-clean@v1.1.0
2323
24 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it24 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
25 - uses: actions/checkout@v325 - uses: actions/checkout@v3.1.0
26 with:26 with:
27 ref: ${{ github.head_ref }} #Checking out head commit27 ref: ${{ github.head_ref }} #Checking out head commit
2828
29 - name: Read .env file29 - name: Read .env file
30 uses: xom9ikk/dotenv@v230 uses: xom9ikk/dotenv@v2
3131
32 - name: Create Execution matrix32 - name: Create Execution matrix
33 uses: CertainLach/create-matrix-action@v333 uses: CertainLach/create-matrix-action@v4
34 id: create_matrix34 id: create_matrix
35 with:35 with:
36 matrix: |36 matrix: |
40 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}40 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}
41
42
43 forkless-nodata-build:
44 needs: prepare-execution-marix
45 # The type of runner that the job will run on
46 runs-on: [self-hosted-ci,large]
47
48 timeout-minutes: 1380
49
50 name: ${{ matrix.network }}-nodata-build
51
52 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
53
54 strategy:
55 matrix:
56 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
57
58 steps:
59 - name: Clean Workspace
60 uses: AutoModality/action-clean@v1.1.0
61
62 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
63 - uses: actions/checkout@v3.1.0
64 with:
65 ref: ${{ github.head_ref }} #Checking out head commit
66
67 - name: Read .env file
68 uses: xom9ikk/dotenv@v2
69
70 # Prepare SHA
71 - name: Prepare SHA
72 uses: ./.github/actions/prepare
73
74 - name: Log in to Docker Hub
75 uses: docker/login-action@v2.1.0
76 with:
77 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
78 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
79
80 # Build main image for FORKLESS-UPDATE-NODATA
81 - name: Generate ENV related extend Dockerfile file
82 uses: cuchi/jinja2-action@v1.2.0
83 with:
84 template: .docker/Dockerfile-parachain-upgrade.j2
85 output_file: .docker/Dockerfile-parachain-upgrade.${{ matrix.network }}.yml
86 variables: |
87 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
88 NETWORK=${{ matrix.network }}
89 MAINNET_BRANCH=${{ matrix.mainnet_branch }}
90 WASM_NAME=${{ matrix.wasm_name }}
91 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
92 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
93
94 - name: Show build Dockerfile
95 run: cat .docker/Dockerfile-parachain-upgrade.${{ matrix.network }}.yml
96
97 - name: Generate launch-config-forkless-nodata.json
98 uses: cuchi/jinja2-action@v1.2.0
99 with:
100 template: .docker/forkless-config/launch-config-forkless-nodata.j2
101 output_file: .docker/forkless-config/launch-config-forkless-nodata.json
102 variables: |
103 WASM_NAME=${{ matrix.wasm_name }}
104 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}
105
106 - name: Show launch-config-forkless configuration
107 run: cat .docker/forkless-config/launch-config-forkless-nodata.json
108
109 - name: Run find-and-replace to remove slashes from branch name
110 uses: mad9000/actions-find-and-replace-string@4
111 id: branchname
112 with:
113 source: ${{ github.head_ref }}
114 find: '/'
115 replace: '-'
116
117 - name: Set build SHA
118 shell: bash
119 run: |
120 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
121
122 - name: Build the stack
123 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-upgrade.${{ matrix.network }}.yml --tag uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../
124
125 - name: Push docker image version
126 run: docker push uniquenetwork/ci-forkless-nodata-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA
127
128 - name: Remove builder cache
129 if: always() # run this step always
130 run: |
131 docker builder prune -f
132 docker system prune -f
41133
42134
43 forkless-update-nodata:135 forkless-nodata-tests:
44 needs: execution-marix136 needs: [prepare-execution-marix, forkless-nodata-build]
45 # The type of runner that the job will run on137 # The type of runner that the job will run on
46 runs-on: [self-hosted-ci,large]138 runs-on: [self-hosted-ci, large]
47139
48 timeout-minutes: 1380140 timeout-minutes: 600
49141
50 name: ${{ matrix.network }}-nodata142 name: ${{ matrix.network }}-nodata-tests
51143
52 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.144 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
53145
54 strategy:146 strategy:
55 matrix:147 matrix:
56 include: ${{fromJson(needs.execution-marix.outputs.matrix)}}148 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
57149
58 steps:150 steps:
151 - name: Skip if pull request is in Draft
152 if: github.event.pull_request.draft == true
153 run: exit 1
154
59 - name: Clean Workspace155 - name: Clean Workspace
60 uses: AutoModality/action-clean@v1.1.0156 uses: AutoModality/action-clean@v1.1.0
61157
62 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it158 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
63 - uses: actions/checkout@v3159 - uses: actions/checkout@v3.1.0
64 with:160 with:
65 ref: ${{ github.head_ref }} #Checking out head commit161 ref: ${{ github.head_ref }} #Checking out head commit
66162
67 - name: Read .env file163 - name: Prepare
68 uses: xom9ikk/dotenv@v2164 uses: ./.github/actions/prepare
165
166 - name: Set build SHA
167 shell: bash
168 run: |
169 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
69170
70 - name: Generate ENV related extend file for docker-compose171 - name: Run find-and-replace to remove slashes from branch name
71 uses: cuchi/jinja2-action@v1.2.0172 uses: mad9000/actions-find-and-replace-string@4
173 id: branchname
72 with:174 with:
73 template: .docker/docker-compose.tmp-forkless-nodata.j2175 source: ${{ github.head_ref }}
74 output_file: .docker/docker-compose.${{ matrix.network }}.yml176 find: '/'
75 variables: |177 replace: '-'
76 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
77 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
78 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
79 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
80 # POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}
81 # MAINNET_TAG=${{ matrix.mainnet_tag }}
82 MAINNET_BRANCH=${{ matrix.mainnet_branch }}
83 NETWORK=${{ matrix.network }}
84 # BRANCH=${{ github.head_ref }}
85 WASM_NAME=${{ matrix.wasm_name }}
86178
87 - name: Show build configuration179 - name: Read .env file
88 run: cat .docker/docker-compose.${{ matrix.network }}.yml180 uses: xom9ikk/dotenv@v2
89181
90 - name: Generate launch-config-forkless-nodata.json182 - name: Generate ENV related extend file for docker-compose
91 uses: cuchi/jinja2-action@v1.2.0183 uses: cuchi/jinja2-action@v1.2.0
92 with:184 with:
93 template: .docker/forkless-config/launch-config-forkless-nodata.j2185 template: .docker/docker-compose.forkless-nodata.j2
94 output_file: .docker/launch-config-forkless-nodata.json186 output_file: .docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml
95 variables: |187 variables: |
96 NETWORK=${{ matrix.network }}188 NETWORK=${{ matrix.network }}
97 WASM_NAME=${{ matrix.wasm_name }}189 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA
98 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}
99190
100 - name: Show launch-config-forkless configuration191 - name: Show build configuration
101 run: cat .docker/launch-config-forkless-nodata.json192 run: cat .docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml
102193
103 - uses: actions/setup-node@v3194 - name: Log in to Docker Hub
195 uses: docker/login-action@v2.1.0
104 with:196 with:
105 node-version: 16197 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
198 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
106199
107 - name: Build the stack200 - name: Build the stack
108 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300201 run: docker-compose -f ".docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
202
203 - uses: actions/setup-node@v3.5.1
204 with:
205 node-version: 16
109206
110 - name: Check if docker logs consist logs related to Runtime Upgrade testing.207 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
111 if: success()208 if: success()
112 run: |209 run: |
113 counter=160210 counter=160
114 function check_container_status {211 function check_container_status {
115 docker inspect -f {{.State.Running}} node-parachain212 docker inspect -f {{.State.Running}} forkless-nodata
116 }213 }
117 function do_docker_logs {214 function do_docker_logs {
118 docker logs --details node-parachain 2>&1215 docker logs --details forkless-nodata 2>&1
119 }216 }
120 function is_started {217 function is_started {
121 if [ "$(check_container_status)" == "true" ]; then218 if [ "$(check_container_status)" == "true" ]; then
122 echo "Container: node-parachain RUNNING";219 echo "Container: forkless-nodata RUNNING";
123 echo "Check Docker logs"220 echo "Check Docker logs"
124 DOCKER_LOGS=$(do_docker_logs)221 DOCKER_LOGS=$(do_docker_logs)
125 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then222 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
126 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"223 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
127 return 0224 return 0
128 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then225 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then
129 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"226 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"
130 return 1227 return 1
131 else228 else
132 echo "Message not found in logs output, repeating..."229 echo "Message not found in logs output, repeating..."
133 return 1230 return 1
134 fi231 fi
135 else232 else
136 echo "Container node-parachain not RUNNING"233 echo "Container forkless-nodata not RUNNING"
137 echo "Halting all future checks"234 echo "Halting all future checks"
138 exit 1235 exit 1
139 fi236 fi
140 exit 0237 exit 0
141 }238 }
142 while ! is_started; do239 while ! is_started; do
143 echo "Waiting for special message in log files "240 echo "Waiting for special message in log files "
144 sleep 30s241 sleep 30s
145 counter=$(( $counter - 1 ))242 counter=$(( $counter - 1 ))
146 echo "Counter: $counter"243 echo "Counter: $counter"
147 if [ "$counter" -gt "0" ]; then244 if [ "$counter" -gt "0" ]; then
148 continue245 continue
149 else246 else
150 break247 break
151 fi248 fi
152 done249 done
153 echo "Halting script"250 echo "Halting script"
154 exit 0251 exit 0
155 shell: bash252 shell: bash
156253
157 - name: Collect Docker Logs254 - name: Collect Docker Logs
158 if: success() || failure()255 if: success() || failure()
159 uses: jwalton/gh-docker-logs@v2.2.0256 uses: jwalton/gh-docker-logs@v2.2.1
160 with:257 with:
161 dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}'258 dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.network }}'
162 images: 'node-parachain'
163259
164 - name: Show docker logs260 - name: Show docker logs
165 if: success() || failure()261 if: success() || failure()
166 run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}/node-parachain.log'262 run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.network }}/forkless-nodata.log'
167263
168 - name: Run Parallel tests264 - name: Run Parallel tests
169 working-directory: tests265 working-directory: tests
170 run: |266 run: |
171 yarn install267 yarn install
172 yarn add mochawesome268 yarn add mochawesome
173 node scripts/readyness.js269 ./scripts/wait_for_first_block.sh
174 echo "Ready to start tests"270 echo "Ready to start tests"
175 yarn polkadot-types271 yarn polkadot-types
176 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}272 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
177 env:273 env:
178 RPC_URL: http://127.0.0.1:9933/274 RPC_URL: http://127.0.0.1:9933/
179275
180 - name: Test Report Parallel276 - name: Test Report Parallel
181 uses: phoenix-actions/test-reporting@v8277 uses: phoenix-actions/test-reporting@v10
182 id: test-report-parallel278 id: test-report-parallel
183 if: success() || failure() # run this step even if previous step failed279 if: success() || failure() # run this step even if previous step failed
184 with:280 with:
190 - name: Run Sequential tests286 - name: Run Sequential tests
191 working-directory: tests287 working-directory: tests
192 if: success() || failure()288 if: success() || failure()
193 run: |289 run: |
194 yarn install290 yarn install
195 yarn add mochawesome291 yarn add mochawesome
196 node scripts/readyness.js292 ./scripts/wait_for_first_block.sh
197 echo "Ready to start tests"293 echo "Ready to start tests"
198 yarn polkadot-types294 yarn polkadot-types
199 NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}295 NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
200 env:296 env:
201 RPC_URL: http://127.0.0.1:9933/297 RPC_URL: http://127.0.0.1:9933/
202298
203 - name: Test Report Sequential299 - name: Test Report Sequential
204 uses: phoenix-actions/test-reporting@v8300 uses: phoenix-actions/test-reporting@v10
205 id: test-report-sequential301 id: test-report-sequential
206 if: success() || failure() # run this step even if previous step failed302 if: success() || failure() # run this step even if previous step failed
207 with:303 with:
212308
213 - name: Stop running containers309 - name: Stop running containers
214 if: always() # run this step always310 if: always() # run this step always
215 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down311 run: docker-compose -f ".docker/docker-compose.forkless-nodata.${{ matrix.network }}.yml" down
216312
217 - name: Remove builder cache313 - name: Remove builder cache
218 if: always() # run this step always314 if: always() # run this step always
modified.github/workflows/forkless.ymldiffbeforeafterboth
1# Intermediate Nested Workflow for calling subworkflows as a parallel tasks.1# Intermediate Nested Workflow for calling subworkflows as a parallel tasks.
22
3name: Nesting Forkless3# name: Nesting Forkless
44
5on:5# on:
6 workflow_call:6# workflow_call:
77
8jobs:8# jobs:
9 9
10 forkless-update-data:10# forkless-update-data:
11 name: with data11# name: with data
12 uses: ./.github/workflows/forkless-update-data.yml12# uses: ./.github/workflows/forkless-update-data.yml
1313# secrets: inherit # pass all secrets from initial workflow to nested
14 forkless-update-no-data:14
15 name: no data15# forkless-update-no-data:
16 uses: ./.github/workflows/forkless-update-nodata.yml16# name: no data
1717# uses: ./.github/workflows/forkless-update-nodata.yml
18 try-runtime:18# secrets: inherit # pass all secrets from initial workflow to nested
19 name: try-runtime19
20 uses: ./.github/workflows/try-runtime.yml20# try-runtime:
21# name: try-runtime
22# uses: ./.github/workflows/try-runtime.yml
23# secrets: inherit # pass all secrets from initial workflow to nested
2124
modified.github/workflows/generate-execution-matrix.ymldiffbeforeafterboth
28 uses: AutoModality/action-clean@v1.1.028 uses: AutoModality/action-clean@v1.1.0
2929
30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31 - uses: actions/checkout@v331 - uses: actions/checkout@v3.1.0
32 with:32 with:
33 ref: ${{ github.head_ref }} #Checking out head commit33 ref: ${{ github.head_ref }} #Checking out head commit
3434
35 - name: Read .env file35 - name: Read .env file
36 uses: xom9ikk/dotenv@v236 uses: xom9ikk/dotenv@v2
3737
38 - name: Create Execution matrix38 - name: Create Execution matrix
39 uses: CertainLach/create-matrix-action@v339 uses: CertainLach/create-matrix-action@v4
40 id: create_matrix40 id: create_matrix
41 with:41 with:
42 matrix: |42 matrix: |
modified.github/workflows/market-test.ymldiffbeforeafterboth
36 ref: ${{ github.head_ref }} #Checking out head commit36 ref: ${{ github.head_ref }} #Checking out head commit
3737
38 - name: Checkout Market e2e tests38 - name: Checkout Market e2e tests
39 uses: actions/checkout@v339 uses: actions/checkout@v3.1.0
40 with:40 with:
41 repository: 'UniqueNetwork/market-e2e-tests'41 repository: 'UniqueNetwork/market-e2e-tests'
42 ssh-key: ${{ secrets.GH_PAT }}42 ssh-key: ${{ secrets.GH_PAT }}
72 working-directory: qa-tests72 working-directory: qa-tests
73 run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain 73 run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain
74 74
75 - uses: actions/setup-node@v375 - uses: actions/setup-node@v3.5.1
76 with:76 with:
77 node-version: 16.1777 node-version: 16.17
7878
93# working-directory: tests93# working-directory: tests
94# run: |94# run: |
95# yarn install95# yarn install
96# node scripts/readyness.js96# ./scripts/wait_for_first_block.sh
97# echo "Ready to start tests"97# echo "Ready to start tests"
98# env:98# env:
99# RPC_URL: http://127.0.0.1:9933/99# RPC_URL: http://127.0.0.1:9933/
modified.github/workflows/node-only-update.ymldiffbeforeafterboth
25 uses: AutoModality/action-clean@v1.1.025 uses: AutoModality/action-clean@v1.1.0
2626
27 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it27 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28 - uses: actions/checkout@v328 - uses: actions/checkout@v3.1.0
29 with:29 with:
30 ref: ${{ github.head_ref }} #Checking out head commit30 ref: ${{ github.head_ref }} #Checking out head commit
3131
32 - name: Read .env file32 - name: Read .env file
33 uses: xom9ikk/dotenv@v233 uses: xom9ikk/dotenv@v2
3434
35 - name: Create Execution matrix35 - name: Create Execution matrix
36 uses: CertainLach/create-matrix-action@v336 uses: CertainLach/create-matrix-action@v4
37 id: create_matrix37 id: create_matrix
38 with:38 with:
39 matrix: |39 matrix: |
64 uses: AutoModality/action-clean@v1.1.064 uses: AutoModality/action-clean@v1.1.0
6565
66 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it66 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
67 - uses: actions/checkout@v367 - uses: actions/checkout@v3.1.0
68 with:68 with:
69 ref: ${{ github.head_ref }} #Checking out head commit69 ref: ${{ github.head_ref }} #Checking out head commit
7070
104 - name: Show launch-config-forkless configuration104 - name: Show launch-config-forkless configuration
105 run: cat .docker/launch-config-forkless-nodata.json105 run: cat .docker/launch-config-forkless-nodata.json
106106
107 - uses: actions/setup-node@v3107 - uses: actions/setup-node@v3.5.1
108 with:108 with:
109 node-version: 16109 node-version: 16
110110
166 - name: Run Parallel tests before Node Parachain upgrade166 - name: Run Parallel tests before Node Parachain upgrade
167 working-directory: ${{ matrix.mainnet_branch }}/tests167 working-directory: ${{ matrix.mainnet_branch }}/tests
168 if: success() || failure()168 if: success() || failure()
169 run: |169 run: |
170 yarn install170 yarn install
171 yarn add mochawesome171 yarn add mochawesome
172 node scripts/readyness.js172 ./scripts/wait_for_first_block.sh
173 echo "Ready to start tests"173 echo "Ready to start tests"
174 yarn polkadot-types174 yarn polkadot-types
175 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}175 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
176 env:176 env:
177 RPC_URL: http://127.0.0.1:9933/177 RPC_URL: http://127.0.0.1:9933/
178178
194 RPC_URL: http://127.0.0.1:9933/194 RPC_URL: http://127.0.0.1:9933/
195195
196 # - name: Upload Sequential Test Report Before Node upgrade196 # - name: Upload Sequential Test Report Before Node upgrade
197 # uses: phoenix-actions/test-reporting@v8197 # uses: phoenix-actions/test-reporting@v10
198 # id: test-sequential-report-before198 # id: test-sequential-report-before
199 # if: success() || failure() # run this step even if previous step failed199 # if: success() || failure() # run this step even if previous step failed
200 # with:200 # with:
289 - name: Run Parallel tests after Node Parachain upgrade289 - name: Run Parallel tests after Node Parachain upgrade
290 working-directory: ${{ matrix.mainnet_branch }}/tests290 working-directory: ${{ matrix.mainnet_branch }}/tests
291 if: success() || failure() # run this step even if previous step failed291 if: success() || failure() # run this step even if previous step failed
292 run: |292 run: |
293 yarn install293 yarn install
294 yarn add mochawesome294 yarn add mochawesome
295 node scripts/readyness.js295 ./scripts/wait_for_first_block.sh
296 echo "Ready to start tests"296 echo "Ready to start tests"
297 yarn polkadot-types297 yarn polkadot-types
298 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}298 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
299 env:299 env:
300 RPC_URL: http://127.0.0.1:9933/300 RPC_URL: http://127.0.0.1:9933/
301301
302 #- name: Test Report Parallel After Node upgrade302 #- name: Test Report Parallel After Node upgrade
303 # uses: phoenix-actions/test-reporting@v8303 # uses: phoenix-actions/test-reporting@v10
304 # id: test-report-parallel-after304 # id: test-report-parallel-after
305 # if: success() || failure() # run this step even if previous step failed305 # if: success() || failure() # run this step even if previous step failed
306 # with:306 # with:
317 RPC_URL: http://127.0.0.1:9933/317 RPC_URL: http://127.0.0.1:9933/
318318
319 #- name: Upload Sequential Test Report After Node upgrade319 #- name: Upload Sequential Test Report After Node upgrade
320 # uses: phoenix-actions/test-reporting@v8320 # uses: phoenix-actions/test-reporting@v10
321 # id: test-sequential-report-after321 # id: test-sequential-report-after
322 # if: success() || failure() # run this step even if previous step failed322 # if: success() || failure() # run this step even if previous step failed
323 # with:323 # with:
modified.github/workflows/polkadot-types.ymldiffbeforeafterboth
66 - name: Build the stack66 - name: Build the stack
67 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans67 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
6868
69 - uses: actions/setup-node@v369 - uses: actions/setup-node@v3.5.1
70 with:70 with:
71 node-version: 1671 node-version: 16
7272
modified.github/workflows/testnet-build.ymldiffbeforeafterboth
28 uses: AutoModality/action-clean@v1.1.028 uses: AutoModality/action-clean@v1.1.0
2929
30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31 - uses: actions/checkout@v331 - uses: actions/checkout@v3.1.0
32 with:32 with:
33 ref: ${{ github.head_ref }} #Checking out head commit33 ref: ${{ github.head_ref }} #Checking out head commit
3434
35 - name: Read .env file35 - name: Read .env file
36 uses: xom9ikk/dotenv@v236 uses: xom9ikk/dotenv@v2
3737
38 - name: Create Execution matrix38 - name: Create Execution matrix
39 uses: fabiocaccamo/create-matrix-action@v239 uses: CertainLach/create-matrix-action@v4
40 id: create_matrix40 id: create_matrix
41 with:41 with:
42 matrix: |42 matrix: |
68 uses: AutoModality/action-clean@v1.1.068 uses: AutoModality/action-clean@v1.1.0
6969
70 # 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@v371 - uses: actions/checkout@v3.1.0
72 with:72 with:
73 ref: ${{ github.head_ref }} #Checking out head commit73 ref: ${{ github.head_ref }} #Checking out head commit
7474
95 run: cat launch-config.json95 run: cat launch-config.json
9696
97 - name: Run find-and-replace to remove slashes from branch name97 - name: Run find-and-replace to remove slashes from branch name
98 uses: mad9000/actions-find-and-replace-string@298 uses: mad9000/actions-find-and-replace-string@4
99 id: branchname99 id: branchname
100 with:100 with:
101 source: ${{ github.head_ref }}101 source: ${{ github.head_ref }}
102 find: '/'102 find: '/'
103 replace: '-'103 replace: '-'
104104
105 - name: Log in to Docker Hub105 - name: Log in to Docker Hub
106 uses: docker/login-action@v2.0.0106 uses: docker/login-action@v2.1.0
107 with:107 with:
108 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}108 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
109 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}109 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
modified.github/workflows/try-runtime.ymldiffbeforeafterboth
21 uses: AutoModality/action-clean@v1.1.021 uses: AutoModality/action-clean@v1.1.0
2222
23 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it23 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24 - uses: actions/checkout@v324 - uses: actions/checkout@v3.1.0
25 with:25 with:
26 ref: ${{ github.head_ref }} #Checking out head commit26 ref: ${{ github.head_ref }} #Checking out head commit
2727
28 - name: Read .env file28 - name: Read .env file
29 uses: xom9ikk/dotenv@v229 uses: xom9ikk/dotenv@v2
3030
31 - name: Create Execution matrix31 - name: Create Execution matrix
32 uses: CertainLach/create-matrix-action@v332 uses: CertainLach/create-matrix-action@v4
33 id: create_matrix33 id: create_matrix
34 with:34 with:
35 matrix: |35 matrix: |
38 network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}38 network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}
39 network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}39 network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}
40
41 try-runtime-build:
42 needs: prepare-execution-marix
43
44 # The type of runner that the job will run on
45 runs-on: [self-hosted-ci]
46 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
47
48 name: ${{ matrix.network }}-try-runtime-build
49 strategy:
50 matrix:
51 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
52
53 steps:
54
55 - name: Clean Workspace
56 uses: AutoModality/action-clean@v1.1.0
57
58 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
59 - uses: actions/checkout@v3.1.0
60 with:
61 ref: ${{ github.head_ref }} #Checking out head commit
62
63 # Prepare SHA
64 - name: Prepare SHA
65 uses: ./.github/actions/prepare
66
67 - name: Read .env file
68 uses: xom9ikk/dotenv@v2
69
70 - name: Log in to Docker Hub
71 uses: docker/login-action@v2.1.0
72 with:
73 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
74 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
75
76 # Build main image for TRY-RUNTIME
77 - name: Generate ENV related extend Dockerfile file
78 uses: cuchi/jinja2-action@v1.2.0
79 with:
80 template: .docker/Dockerfile-try-runtime.j2
81 output_file: .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml
82 variables: |
83 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
84 NETWORK=${{ matrix.network }}
85 WASM_NAME=${{ matrix.wasm_name }}
86 REPLICA_FROM=${{ matrix.replica_from_address }}
87
88 - name: Show build Dockerfile
89 run: cat .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml
90
91 - name: Run find-and-replace to remove slashes from branch name
92 uses: mad9000/actions-find-and-replace-string@4
93 id: branchname
94 with:
95 source: ${{ github.head_ref }}
96 find: '/'
97 replace: '-'
98
99 - name: Set build SHA
100 shell: bash
101 run: |
102 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
103
104 - name: Build the stack
105 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-try-runtime.${{ matrix.network }}.yml --tag uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../
106
107 - name: Push docker image version
108 run: docker push uniquenetwork/ci-tryruntime-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA
109
110 - name: Remove builder cache
111 if: always() # run this step always
112 run: |
113 docker builder prune -f
114 docker system prune -f
115
40116
41 try-runtime:117 try-runtime-tests:
42 needs: prepare-execution-marix118 needs: [prepare-execution-marix, try-runtime-build]
43
44 # The type of runner that the job will run on119 # The type of runner that the job will run on
45 runs-on: [self-hosted-ci]120 runs-on: [self-hosted-ci]
121
122 timeout-minutes: 600
123
124 name: ${{ matrix.network }}-try-runtime-tests
125
46 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.126 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
47127
48 name: ${{ matrix.network }}-try-runtime
49 strategy:128 strategy:
50 matrix:129 matrix:
51 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}130 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
52131
53 steps:132 steps:
133 - name: Skip if pull request is in Draft
134 if: github.event.pull_request.draft == true
135 run: exit 1
54136
55 - name: Clean Workspace137 - name: Clean Workspace
56 uses: AutoModality/action-clean@v1.1.0138 uses: AutoModality/action-clean@v1.1.0
57139
58 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it140 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
59 - uses: actions/checkout@v3141 - uses: actions/checkout@v3.1.0
60 with:142 with:
61 ref: ${{ github.head_ref }} #Checking out head commit143 ref: ${{ github.head_ref }} #Checking out head commit
144
145 - name: Prepare
146 uses: ./.github/actions/prepare
147
148 - name: Set build SHA
149 shell: bash
150 run: |
151 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
152
153 - name: Run find-and-replace to remove slashes from branch name
154 uses: mad9000/actions-find-and-replace-string@4
155 id: branchname
156 with:
157 source: ${{ github.head_ref }}
158 find: '/'
159 replace: '-'
62160
63 - name: Read .env file161 - name: Read .env file
64 uses: xom9ikk/dotenv@v2162 uses: xom9ikk/dotenv@v2
65163
66 - name: Generate ENV related extend file for docker-compose164 - name: Generate ENV related extend file for docker-compose
67 uses: cuchi/jinja2-action@v1.2.0165 uses: cuchi/jinja2-action@v1.2.0
68 with:166 with:
69 template: .docker/docker-compose.tmp-try-runtime.j2167 template: .docker/docker-compose.try-runtime.j2
70 output_file: .docker/docker-compose.try-runtime.${{ matrix.network }}.yml168 output_file: .docker/docker-compose.try-runtime.${{ matrix.network }}.yml
71 variables: |169 variables: |
72 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}170 NETWORK=${{ matrix.network }}
73 NETWORK=${{ matrix.network }}171 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA
74 WASM_NAME=${{ matrix.wasm_name }}
75 REPLICA_FROM=${{ matrix.replica_from_address }}
76172
77 - name: Show build configuration173 - name: Show build configuration
78 run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml174 run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml
175
176 - uses: actions/setup-node@v3.5.1
177 with:
178 node-version: 16
179
180 - name: Log in to Docker Hub
181 uses: docker/login-action@v2.1.0
182 with:
183 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
184 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
79185
80 - name: Build the stack186 - name: Build the stack
81 run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from try-runtime187 run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
82188
83 - name: Collect Docker Logs189 - name: Collect Docker Logs
84 if: success() || failure()190 if: success() || failure()
85 uses: jwalton/gh-docker-logs@v2.2.0191 uses: jwalton/gh-docker-logs@v2.2.1
86 with:192 with:
87 dest: './try-runtime-logs.${{ matrix.network }}'193 dest: './try-runtime-logs.${{ matrix.network }}'
88 images: 'try-runtime'
89194
90 - name: Show docker logs195 - name: Show docker logs
91 run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log'196 run: cat './try-runtime-logs.${{ matrix.network }}/try-runtime.log'
modified.github/workflows/unit-test.ymldiffbeforeafterboth
26 uses: AutoModality/action-clean@v1.1.025 uses: AutoModality/action-clean@v1.1.0
2726
28 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it27 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29 - uses: actions/checkout@v328 - uses: actions/checkout@v3.1.0
30 with:29 with:
31 ref: ${{ github.head_ref }} #Checking out head commit30 ref: ${{ github.head_ref }} #Checking out head commit
3231
modified.github/workflows/xcm.ymldiffbeforeafterboth
28 uses: AutoModality/action-clean@v1.1.028 uses: AutoModality/action-clean@v1.1.0
2929
30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it30 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31 - uses: actions/checkout@v331 - uses: actions/checkout@v3.1.0
32 with:32 with:
33 ref: ${{ github.head_ref }} #Checking out head commit33 ref: ${{ github.head_ref }} #Checking out head commit
3434
35 - name: Read .env file35 - name: Read .env file
36 uses: xom9ikk/dotenv@v236 uses: xom9ikk/dotenv@v2
3737
38 - name: Create Execution matrix38 - name: Create Execution matrix
39 uses: fabiocaccamo/create-matrix-action@v239 uses: CertainLach/create-matrix-action@v4
40 id: create_matrix40 id: create_matrix
41 with:41 with:
42 matrix: |42 matrix: |
69 uses: AutoModality/action-clean@v1.1.069 uses: AutoModality/action-clean@v1.1.0
7070
71 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it71 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
72 - uses: actions/checkout@v372 - uses: actions/checkout@v3.1.0
73 with:73 with:
74 ref: ${{ github.head_ref }} #Checking out head commit74 ref: ${{ github.head_ref }} #Checking out head commit
75
76 # Prepare SHA
77 - name: Prepare SHA
78 uses: ./.github/actions/prepare
7579
76 - name: Read .env file80 - name: Read .env file
77 uses: xom9ikk/dotenv@v281 uses: xom9ikk/dotenv@v2
7882
79 - name: Log in to Docker Hub83 - name: Log in to Docker Hub
80 uses: docker/login-action@v2.0.084 uses: docker/login-action@v2.1.0
81 with:85 with:
82 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}86 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
83 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}87 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
8488
85 - name: Install jq89 # Check POLKADOT version and build it if it doesn't exist in repository
86 run: sudo apt install jq -y
87
88 # Check POLKADOT version and build it if it doesn't exist in repository
89 - name: Generate ENV related extend Dockerfile file for POLKADOT90 - name: Generate ENV related extend Dockerfile file for POLKADOT
90 uses: cuchi/jinja2-action@v1.2.091 uses: cuchi/jinja2-action@v1.2.0
91 with:92 with:
251 fi251 fi
252 shell: bash252 shell: bash
253253
254 - name: Pull chainql docker image
255 run: docker pull uniquenetwork/builder-chainql:latest
254256
255 - name: Generate ENV related extend launch-config file257 - name: Generate ENV related extend launch-config file
256 uses: cuchi/jinja2-action@v1.2.0258 uses: cuchi/jinja2-action@v1.2.0
284 run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml286 run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
285287
286 - name: Run find-and-replace to remove slashes from branch name288 - name: Run find-and-replace to remove slashes from branch name
287 uses: mad9000/actions-find-and-replace-string@2289 uses: mad9000/actions-find-and-replace-string@4
288 id: branchname290 id: branchname
289 with:291 with:
290 source: ${{ github.head_ref }}292 source: ${{ github.head_ref }}
291 find: '/'293 find: '/'
292 replace: '-'294 replace: '-'
293295
294 - name: Pull chainql docker image296 - name: Set build SHA
297 shell: bash
295 run: docker pull uniquenetwork/builder-chainql:latest298 run: |
299 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
296300
297 - name: Build the stack301 - name: Build the stack
298 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .302 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA .
299303
300 - name: Push docker image version304 - name: Push docker image version
301 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}305 run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA
302
303 - name: Push docker image latest
304 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
305306
306 - name: Remove builder cache307 - name: Remove builder cache
307 if: always() # run this step always308 if: always() # run this step always
333 uses: AutoModality/action-clean@v1.1.0334 uses: AutoModality/action-clean@v1.1.0
334335
335 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it336 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
336 - uses: actions/checkout@v3337 - uses: actions/checkout@v3.1.0
337 with:338 with:
338 ref: ${{ github.head_ref }} #Checking out head commit339 ref: ${{ github.head_ref }} #Checking out head commit
340
341 - name: Prepare
342 uses: ./.github/actions/prepare
343
344 - name: Set build SHA
345 shell: bash
346 run: |
347 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
348
349 - name: Run find-and-replace to remove slashes from branch name
350 uses: mad9000/actions-find-and-replace-string@4
351 id: branchname
352 with:
353 source: ${{ github.head_ref }}
354 find: '/'
355 replace: '-'
339356
340 - name: Read .env file357 - name: Read .env file
341 uses: xom9ikk/dotenv@v2358 uses: xom9ikk/dotenv@v2
342359
343 - name: Generate ENV related extend file for docker-compose360 - name: Generate ENV related extend file for docker-compose
344 uses: cuchi/jinja2-action@v1.2.0361 uses: cuchi/jinja2-action@v1.2.0
345 with:362 with:
346 template: .docker/docker-compose.tmp-xcm-tests.j2363 template: .docker/docker-compose.xcm.j2
347 output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml364 output_file: .docker/docker-compose.xcm.${{ matrix.network }}.yml
348 variables: |365 variables: |
349 NETWORK=${{ matrix.network }}366 NETWORK=${{ matrix.network }}
367 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA
350368
351 - name: Show build configuration369 - name: Show build configuration
352 run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml370 run: cat .docker/docker-compose.xcm.${{ matrix.network }}.yml
353371
354 - uses: actions/setup-node@v3372 - uses: actions/setup-node@v3.5.1
355 with:373 with:
356 node-version: 16374 node-version: 16
375
376 - name: Log in to Docker Hub
377 uses: docker/login-action@v2.1.0
378 with:
379 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
380 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
357381
358 - name: Build the stack382 - name: Build the stack
359 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300383 run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
360384
361 # 🚀 POLKADOT LAUNCH COMPLETE 🚀385 # 🚀 POLKADOT LAUNCH COMPLETE 🚀
362 - name: Check if docker logs consist messages related to testing of xcm tests 386 - name: Check if docker logs consist messages related to testing of xcm tests
363 if: success()387 if: success()
364 run: |388 run: |
365 counter=160389 counter=160
366 function check_container_status {390 function check_container_status {
367 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local391 docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-local
368 }392 }
369 function do_docker_logs {393 function do_docker_logs {
370 docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1394 docker logs --details xcm-${{ matrix.network }}-local 2>&1
371 }395 }
372 function is_started {396 function is_started {
373 if [ "$(check_container_status)" == "true" ]; then397 if [ "$(check_container_status)" == "true" ]; then
374 echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";398 echo "Container: xcm-${{ matrix.network }}-local RUNNING";
375 echo "Check Docker logs"399 echo "Check Docker logs"
376 DOCKER_LOGS=$(do_docker_logs)400 DOCKER_LOGS=$(do_docker_logs)
377 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then401 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
378 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"402 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
379 return 0403 return 0
380 else404 else
381 echo "Message not found in logs output, repeating..."405 echo "Message not found in logs output, repeating..."
382 return 1406 return 1
383 fi407 fi
384 else408 else
385 echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"409 echo "Container xcm-${{ matrix.network }}-local NOT RUNNING"
386 echo "Halting all future checks"410 echo "Halting all future checks"
387 exit 1411 exit 1
388 fi412 fi
389 echo "something goes wrong"413 echo "something goes wrong"
390 exit 1414 exit 1
391 }415 }
392 while ! is_started; do416 while ! is_started; do
393 echo "Waiting for special message in log files "417 echo "Waiting for special message in log files "
394 sleep 30s418 sleep 30s
395 counter=$(( $counter - 1 ))419 counter=$(( $counter - 1 ))
396 echo "Counter: $counter"420 echo "Counter: $counter"
397 if [ "$counter" -gt "0" ]; then421 if [ "$counter" -gt "0" ]; then
398 continue422 continue
399 else423 else
400 break424 break
401 fi425 fi
402 done426 done
403 echo "Halting script"427 echo "Halting script"
404 exit 0428 exit 0
405 shell: bash429 shell: bash
406430
407 - name: Run XCM tests 431 - name: Run XCM tests
408 working-directory: tests432 working-directory: tests
409 run: |433 run: |
410 yarn install434 yarn install
411 yarn add mochawesome435 yarn add mochawesome
412 node scripts/readyness.js436 ./scripts/wait_for_first_block.sh
413 echo "Ready to start tests"437 echo "Ready to start tests"
414 yarn polkadot-types 438 yarn polkadot-types
415 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}439 NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
416 env:440 env:
417 RPC_URL: http://127.0.0.1:9933/441 RPC_URL: http://127.0.0.1:9933/
418442
419 - name: XCM Test Report443 - name: XCM Test Report
420 uses: phoenix-actions/test-reporting@v8444 uses: phoenix-actions/test-reporting@v10
421 id: test-report445 id: test-report
422 if: success() || failure() # run this step even if previous step failed446 if: success() || failure() # run this step even if previous step failed
423 with:447 with:
428452
429 - name: Show container logs453 - name: Show container logs
430 if: always() # run this step always454 if: always() # run this step always
431 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" logs455 run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" logs
432456
433 - name: Stop running containers457 - name: Stop running containers
434 if: always() # run this step always458 if: always() # run this step always
435 run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down459 run: docker-compose -f ".docker/docker-compose.xcm.${{ matrix.network }}.yml" down
436460
437 - name: Clean Workspace461 - name: Clean Workspace
438 if: always()462 if: always()
modified.github/workflows/yarn-dev.ymldiffbeforeafterboth
34 uses: AutoModality/action-clean@v1.1.034 uses: AutoModality/action-clean@v1.1.0
3535
36 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it36 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
37 - uses: actions/checkout@v337 - uses: actions/checkout@v3.1.0
38 with:38 with:
39 ref: ${{ github.head_ref }} #Checking out head commit39 ref: ${{ github.head_ref }} #Checking out head commit
4040
57 - name: Build the stack57 - name: Build the stack
58 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans58 run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
5959
60 - uses: actions/setup-node@v360 - uses: actions/setup-node@v3.5.1
61 with:61 with:
62 node-version: 1662 node-version: 16
6363
64 - name: Run tests64 - name: Run tests
65 working-directory: tests65 working-directory: tests
66 run: |66 run: |
67 yarn install67 yarn install
68 yarn add mochawesome68 yarn add mochawesome
69 node scripts/readyness.js69 ./scripts/wait_for_first_block.sh
70 echo "Ready to start tests"70 echo "Ready to start tests"
71 yarn polkadot-types71 yarn polkadot-types
72 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}72 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
73 env:73 env:
74 RPC_URL: http://127.0.0.1:9933/74 RPC_URL: http://127.0.0.1:9933/
7575
76 - name: Test Report76 - name: Test Report
77 uses: phoenix-actions/test-reporting@v877 uses: phoenix-actions/test-reporting@v10
78 id: test-report78 id: test-report
79 if: success() || failure() # run this step even if previous step failed79 if: success() || failure() # run this step even if previous step failed
80 with:80 with:
98 docker system prune -f98 docker system prune -f
99 docker image prune -f -a99 docker image prune -f -a
100100
101 # check:
102 # if: always()
103 # runs-on: [self-hosted-ci]
104 # needs:
105 # - dev_build_int_tests
106
107 # steps:
108 # - name: Install python3
109 # uses: actions/setup-python@v4
110 # with:
111 # python-version: '3.10'
112
113 # - name: Decide whether the needed jobs succeeded or failed
114 # uses: re-actors/alls-green@v1.2.2
115 # with:
116 # jobs: ${{ toJSON(needs) }}