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

difftreelog

Merge pull request #796 from UniqueNetwork/feature/generate-types-package

Yaroslav Bolyukin2022-12-23parents: #ceb8459 #acb4a73.patch.diff
in: master
Feature/generate types package

3 files changed

modified.github/workflows/ci-master.ymldiffbeforeafterboth
before · .github/workflows/ci-master.yml
1# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656193/CI+Master2# Workflow which controls starts nested workflows.3name: master45# Triger: PR at 'master' branch with following types of events.6on:7  pull_request:8    branches: [ 'master' ]9    types: [ opened, reopened, synchronize, ready_for_review ]1011#Concurency group for control execution queue over github runners.12concurrency:13  group: ${{ github.workflow }}-${{ github.head_ref }}14  cancel-in-progress: true1516# List of a jobs included into Workflow.17jobs:1819  yarn-dev:20    uses: ./.github/workflows/yarn-dev.yml2122  unit-test:23    uses: ./.github/workflows/unit-test.yml2425  node-only-update:26    uses: ./.github/workflows/node-only-update.yml2728  forkless:29    uses: ./.github/workflows/forkless.yml3031  # canary:32  #   uses: ./.github/workflows/canary.yml33  #   secrets: inherit # pass all secrets from initial workflow to nested3435  xcm:36    uses: ./.github/workflows/xcm.yml37    secrets: inherit # pass all secrets from initial workflow to nested3839  # testnet:40  #   uses: ./.github/workflows/testnet-build.yml41  #   secrets: inherit # pass all secrets from initial workflow to nested4243  codestyle:44    uses: ./.github/workflows/codestyle.yml
after · .github/workflows/ci-master.yml
1# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656193/CI+Master2# Workflow which controls starts nested workflows.3name: master45# Triger: PR at 'master' branch with following types of events.6on:7  pull_request:8    branches: [ 'master' ]9    types: [ opened, reopened, synchronize, ready_for_review ]1011#Concurency group for control execution queue over github runners.12concurrency:13  group: ${{ github.workflow }}-${{ github.head_ref }}14  cancel-in-progress: true1516# List of a jobs included into Workflow.17jobs:1819  yarn-dev:20    uses: ./.github/workflows/yarn-dev.yml2122  unit-test:23    uses: ./.github/workflows/unit-test.yml2425  node-only-update:26    uses: ./.github/workflows/node-only-update.yml2728  forkless:29    uses: ./.github/workflows/forkless.yml3031  # canary:32  #   uses: ./.github/workflows/canary.yml33  #   secrets: inherit # pass all secrets from initial workflow to nested3435  xcm:36    uses: ./.github/workflows/xcm.yml37    secrets: inherit # pass all secrets from initial workflow to nested3839  # testnet:40  #   uses: ./.github/workflows/testnet-build.yml41  #   secrets: inherit # pass all secrets from initial workflow to nested4243  codestyle:44    uses: ./.github/workflows/codestyle.yml4546  polkadot-types:47    uses: ./.github/workflows/polkadot-types.yml
added.github/workflows/polkadot-types.ymldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/polkadot-types.yml
@@ -0,0 +1,96 @@
+# Integration test in --dev mode
+# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests
+name: Polkadot types
+
+# Triger: only call from main workflow(re-usable workflows)
+on:
+  workflow_call:
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+# on:
+#   pull_request:
+#     branches: [ 'develop' ]
+#     types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ]
+
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+  
+  polkadot_generate_types:
+    # The type of runner that the job will run on
+    runs-on: [self-hosted-ci,medium]
+    timeout-minutes: 1380
+
+    name: ${{ matrix.network }}
+
+    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.
+
+    strategy:
+      matrix:
+        include:
+          - network: sapphire
+            usage: "--sapphire"
+          - network: "opal"
+            usage: ""
+          - network: "quartz"
+            usage: ""
+          - network: "unique"
+            usage: ""
+
+    steps:
+
+      - name: Clean Workspace
+        uses: AutoModality/action-clean@v1.1.0
+
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v3
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v2
+
+      - name: Generate ENV related extend file for docker-compose
+        uses: cuchi/jinja2-action@v1.2.0
+        with:
+          template: .docker/docker-compose.tmp-dev.j2
+          output_file: .docker/docker-compose.${{ matrix.network }}.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            NETWORK=${{ matrix.network }}
+   
+      - name: Show build configuration
+        run: cat .docker/docker-compose.${{ matrix.network }}.yml
+
+      - name: Build the stack
+        run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
+
+      - uses: actions/setup-node@v3
+        with:
+          node-version: 16
+
+      - name: Install jq
+        run: sudo apt install jq -y
+
+      - name: Run generate_types_package script
+        working-directory: tests
+        run: |
+          yarn install
+          /bin/bash ./scripts/wait_for_first_block.sh
+          git config --global user.name "Unique"
+          git config --global user.email github-actions@usetech.com          
+          /bin/bash ./scripts/generate_types_package.sh --release ${{ matrix.usage }} --push
+        env:
+          RPC_URL: http://127.0.0.1:9933/
+
+      - name: Stop running containers
+        if: always()                   # run this step always
+        run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+
+      - name: Remove builder cache
+        if: always()                   # run this step always
+        run: |
+          docker builder prune -f -a
+          docker system prune -f
+          docker image prune -f -a
modified.github/workflows/schedule-trigger-for-develop-build.ymldiffbeforeafterboth
--- a/.github/workflows/schedule-trigger-for-develop-build.yml
+++ b/.github/workflows/schedule-trigger-for-develop-build.yml
@@ -1,8 +1,8 @@
 name: schedule-trigger-for-develop-build
 on:
   # update the branch ci/develop-scheduler every night
-  schedule:
-    - cron: '0 1 * * *'
+  # schedule:
+  #   - cron: '0 1 * * *'
   # or update the branch manually
   workflow_dispatch:
   # pull_request: