difftreelog
Added script for readyness check.
in: master
2 files changed
.docker/readyness.jsdiffbeforeafterboth--- /dev/null
+++ b/.docker/readyness.js
@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+const { ApiPromise, WsProvider } = require('@polkadot/api');
+
+const main = async () => {
+ const wsEndpoint = 'ws://127.0.0.1:9944'
+ const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});
+ await api.isReady;
+
+ const head = (await api.rpc.chain.getHeader()).number.toNumber();
+ if(head < 1) throw Error('No block #1');
+
+ await api.disconnect();
+}
+
+main().then(() => process.exit(0)).catch(e => {
+ console.error(e);
+ process.exit(1);
+});
.github/workflows/node_build_test.ymldiffbeforeafterboth41 features: "--features=unique-runtime"41 features: "--features=unique-runtime"424243 steps:43 steps:44 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it44 - name: Skip if pull request is in Draft45 # `if: github.event.pull_request.draft == true` should be kept here, at46 # the step level, rather than at the job level. The latter is not47 # recommended because when the PR is moved from "Draft" to "Ready to48 # review" the workflow will immediately be passing (since it was skipped),49 # even though it hasn't actually ran, since it takes a few seconds for50 # the workflow to start. This is also disclosed in:51 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1752 # That scenario would open an opportunity for the check to be bypassed:53 # 1. Get your PR approved54 # 2. Move it to Draft55 # 3. Push whatever commits you want56 # 4. Move it to "Ready for review"; now the workflow is passing (it was57 # skipped) and "Check reviews" is also passing (it won't be updated58 # until the workflow is finished)59 if: github.event.pull_request.draft == true60 run: exit 16162 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it45 - uses: actions/checkout@v363 - uses: actions/checkout@v346 with:64 with:47 ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit65 ref: ${{ github.event.pull_request.head.sha }} #Checking out head commit64 - name: Build the stack82 - name: Build the stack65 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build83 run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build668467 - name: Wait85 # - name: Wait68 run: sleep 420s86 # run: sleep 420s698770 - name: Install node88 - name: Install node71 uses: actions/setup-node@v189 uses: actions/setup-node@v180 yarn --pure-lockfile98 yarn --pure-lockfile819982 - name: Run tests100 - name: Run tests83 run: |101 run: |84 cd tests102 chmod u+x .docker/readyness.js && .docker/readyness.js103 cd tests85 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}104 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}86 env:105 env:87 RPC_URL: http://127.0.0.1:9933/106 RPC_URL: http://127.0.0.1:9933/88107