difftreelog
Merge pull request #1071 from UniqueNetwork/fix/ci-scripts
in: master
fix path for scripts in workflows
3 files changed
.github/workflows/forkless-update-data.ymldiffbeforeafterboth1# Forkless update with data replication2# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586869792/Forkless+update+with+data34# Triger: only call from main workflow(re-usable workflows)5on:6 workflow_call:789# A workflow run is made up of one or more jobs that can run sequentially or in parallel10jobs:1112 prepare-execution-matrix:1314 name: execution matrix1516 runs-on: self-hosted-ci17 outputs:18 matrix: ${{ steps.create_matrix.outputs.matrix }}1920 steps:2122 - name: Clean Workspace23 uses: AutoModality/action-clean@v1.1.02425 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it26 - uses: actions/checkout@v3.1.027 with:28 ref: ${{ github.head_ref }} #Checking out head commit2930 - name: Read .env file31 uses: xom9ikk/dotenv@v23233 - name: Create Execution matrix34 uses: CertainLach/create-matrix-action@v435 id: create_matrix36 with:37 matrix: |38 network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal}, fork_source {${{ env.OPAL_REPLICA_FROM }}}39 network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}}40 network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}}4142 forkless-data:4344 needs: prepare-execution-matrix45 # The type of runner that the job will run on46 runs-on: [self-hosted-ci,large]4748 timeout-minutes: 13804950 name: ${{ matrix.network }}-data5152 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.5354 strategy:55 matrix:56 include: ${{fromJson(needs.prepare-execution-matrix.outputs.matrix)}}5758 steps:5960 - name: Clean Workspace61 uses: AutoModality/action-clean@v1.1.06263 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it64 - uses: actions/checkout@v3.1.065 with:66 ref: ${{ github.head_ref }} #Checking out head commit6768 # Prepare SHA 69 - name: Prepare SHA70 uses: ./.github/actions/prepare7172 - name: Read .env file73 uses: xom9ikk/dotenv@v27475 - name: Log in to Docker Hub76 uses: docker/login-action@v2.1.077 with:78 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}79 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}8081 - name: Generate ENV related extend Dockerfile file for POLKADOT82 uses: cuchi/jinja2-action@v1.2.083 with:84 template: .docker/Dockerfile-polkadot.j285 output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml86 variables: |87 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}88 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}89 90 - name: Prepare polkadot91 uses: ./.github/actions/buildContainer92 id: polkadot93 with:94 container: uniquenetwork/builder-polkadot95 tag: ${{ matrix.relay_branch }}96 context: .docker97 dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml98 dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}99 dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}100101 - name: Prepare latest102 uses: ./.github/actions/buildContainer103 id: latest104 with:105 container: uniquenetwork/ci-data-${{ matrix.network }}106 tag: ${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}107 context: .108 dockerfile: .docker/Dockerfile-unique109 args: |110 --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}111 --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}112 dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}113 dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}114115 - name: Extract wasms116 uses: ./.github/actions/extractDocker117 id: wasms118 with:119 image: ${{ steps.latest.outputs.name }}120 directory: /wasm121122 - uses: actions/setup-node@v3.5.1123 with:124 node-version: 20125126 - name: Install baedeker127 uses: UniqueNetwork/baedeker-action/setup@built128129 - name: Setup library130 run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library131132 - name: Start network133 uses: UniqueNetwork/baedeker-action@built134 id: bdk135 with:136 jpath: |137 .baedeker/vendor138 tla-str: |139 relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local140 forked_spec=${{ matrix.network }}141 fork_source=${{ matrix.fork_source }}142 inputs: |143 .baedeker/forkless-data.jsonnet144 snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})145 snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}})146147 - name: "Reconcile: runtime is upgraded"148 working-directory: js-packages/tests149 run: |150 yarn151 ../scripts/wait_for_first_block.sh152 echo "Executing upgrade"153 yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm154 env:155 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}156157 - name: Run Parallel tests after forkless upgrade158 working-directory: js-packages/tests159 run: |160 yarn 161 yarn add mochawesome162 ../scripts/wait_for_first_block.sh163 echo "Ready to start tests"164 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}165 env:166 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}167168 - name: Run Sequential tests after forkless upgrade169 if: success() || failure()170 working-directory: js-packages/tests171 run: |172 yarn173 yarn add mochawesome174 NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}175 env:176 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}177178 - name: Remove builder cache179 if: always() # run this step always180 run: |181 docker system prune -f.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-nodata.yml
+++ b/.github/workflows/forkless-update-nodata.yml
@@ -165,7 +165,7 @@
yarn
../scripts/wait_for_first_block.sh
echo "Executing upgrade"
- yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
js-packages/scripts/generate_types/wait_for_first_block.shdiffbeforeafterboth--- a/js-packages/scripts/generate_types/wait_for_first_block.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env bash
-
-DIR=$(dirname "$0")
-
-. "$DIR/functions.sh"
-
-last_block_id=0
-block_id=0
-counter=0
-function get_block {
- block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number)
- block_id=$((block_id_hex))
- echo Id = $block_id
-}
-
-function had_new_block {
- last_block_id=$block_id
- get_block
- if (( last_block_id != 0 && block_id > last_block_id )); then
- return 0
- fi
- return 1
-}
-
-function reset_check {
- last_block_id=0
- block_id=0
- counter=0
-}
-
-while [ ! had_new_block ] && [ $counter -lt 100 ]; do
- echo "Waiting for next block..."
- counter=$((counter+1))
- sleep 12
-done
-
-reset_check
-
-echo "Chain is running, but lets wait for another block after a minute, to avoid startup flakiness."
-sleep 60
-
-while ! had_new_block; do
- echo "Waiting for another block..."
- sleep 12
-done
-
-echo "Chain is running!"