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

difftreelog

Update node-only-update_v3.yml

Alex2022-10-18parent: #450f13a.patch.diff
in: master

1 file changed

modified.github/workflows/node-only-update_v3.ymldiffbeforeafterboth
33 uses: fabiocaccamo/create-matrix-action@v233 uses: fabiocaccamo/create-matrix-action@v2
34 id: create_matrix34 id: create_matrix
35 with:35 with:
36 matrix: |36 matrix: |
37 network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}37 network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}
38 network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}38 network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}
39 network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}39 network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}
40 40
41 nodes-only-update:41 parallel-test:
42 needs: nodes-execution-matrix42 needs: nodes-execution-matrix
43 # The type of runner that the job will run on43 # The type of runner that the job will run on
44 runs-on: [self-hosted-ci,large]44 runs-on: [self-hosted-ci,large]
4747
48 timeout-minutes: 138048 timeout-minutes: 1380
4949
50 name: ${{ matrix.network }}50 name: ${{ matrix.network }} - parallel
5151
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.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.
5353
205 docker system prune -f205 docker system prune -f
206 docker image prune -f -a206 docker image prune -f -a
207 207
208# - name: List files in Workspace208 - name: List files in Workspace
209# if: always()209 if: always()
210# uses: |210 uses: ls -la ./
211# ls -la ./211
212#212 sequential-test:
213 needs: nodes-execution-matrix
214 # The type of runner that the job will run on
215 runs-on: [self-hosted-ci,large]
216
217
218
219 timeout-minutes: 1380
220
221 name: ${{ matrix.network }} - sequential
222
223 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.
224
225 strategy:
226 matrix:
227 include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}}
228
229 steps:
230
231 - name: Clean Workspace
232 uses: AutoModality/action-clean@v1.1.0
233
234 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
235 - uses: actions/checkout@v3
236 with:
237 ref: ${{ github.head_ref }} #Checking out head commit
238
239 - name: Read .env file
240 uses: xom9ikk/dotenv@v1.0.2
241
242 - name: Generate ENV related extend file for docker-compose
243 uses: cuchi/jinja2-action@v1.2.0
244 with:
245 template: .docker/docker-compose.tmp-node.j2
246 output_file: .docker/docker-compose.node.${{ matrix.network }}.yml
247 variables: |
248 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
249 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
250 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
251 POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}
252 MAINNET_TAG=${{ matrix.mainnet_tag }}
253 MAINNET_BRANCH=${{ matrix.mainnet_branch }}
254 FEATURE=${{ matrix.features }}
255 RUNTIME=${{ matrix.runtime }}
256 BRANCH=${{ github.head_ref }}
257
258 - name: Show build configuration
259 run: cat .docker/docker-compose.node.${{ matrix.network }}.yml
260
261 - name: Generate launch-config-forkless-nodata.json
262 uses: cuchi/jinja2-action@v1.2.0
263 with:
264 template: .docker/forkless-config/launch-config-node-update-only-v3.j2
265 output_file: .docker/launch-config-forkless-nodata.json
266 variables: |
267 FEATURE=${{ matrix.features }}
268 RUNTIME=${{ matrix.runtime }}
269
270 - name: Show launch-config-forkless configuration
271 run: cat .docker/launch-config-forkless-nodata.json
272
273 - uses: actions/setup-node@v3
274 with:
275 node-version: 16
276
277 - name: Build the stack
278 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300
279
280 # 🚀 POLKADOT LAUNCH COMPLETE 🚀
281 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.
282 if: success()
283 run: |
284 counter=160
285 function check_container_status {
286 docker inspect -f {{.State.Running}} node-parachain
287 }
288 function do_docker_logs {
289 docker logs --details node-parachain 2>&1
290 }
291 function is_started {
292 if [ "$(check_container_status)" == "true" ]; then
293 echo "Container: node-parachain RUNNING";
294 echo "Check Docker logs"
295 DOCKER_LOGS=$(do_docker_logs)
296 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
297 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
298 return 0
299 else
300 echo "Message not found in logs output, repeating..."
301 return 1
302 fi
303 else
304 echo "Container node-parachain NOT RUNNING"
305 echo "Halting all future checks"
306 exit 1
307 fi
308 echo "something goes wrong"
309 exit 1
310 }
311 while ! is_started; do
312 echo "Waiting for special message in log files "
313 sleep 30s
314 counter=$(( $counter - 1 ))
315 echo "Counter: $counter"
316 if [ "$counter" -gt "0" ]; then
317 continue
318 else
319 break
320 fi
321 done
322 echo "Halting script"
323 exit 0
324 shell: bash
325
326 - name: Run Sequential tests on Node Parachain
327 working-directory: ${{ matrix.mainnet_branch }}/tests
328 run: |
329 yarn install
330 yarn add mochawesome
331 echo "Ready to start tests"
332 yarn polkadot-types
333 NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
334 env:
335 RPC_URL: http://127.0.0.1:9933/
336
337 - name: Sequential Tests report
338 uses: phoenix-actions/test-reporting@v8
339 id: test-report-sequential
340 if: success() || failure() # run this step even if previous step failed
341 with:
342 name: Parallel Tests report - ${{ matrix.network }} # Name of the check run which will be created
343 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results
344 reporter: mochawesome-json
345 fail-on-error: 'false'
346
347 - name: Stop running containers
348 if: always() # run this step always
349 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes
350
351 - name: Remove builder cache
352 if: always() # run this step always
353 run: |
354 docker builder prune -f -a
355 docker system prune -f
356 docker image prune -f -a
357
358 - name: List files in Workspace
359 if: always()
360 uses: ls -la ./
213361