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
43 codestyle:43 codestyle:
44 uses: ./.github/workflows/codestyle.yml44 uses: ./.github/workflows/codestyle.yml
4545
46 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: