From 9d577f5d3aefe09a4a5c0a3b92f24372d18f3cd7 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Mon, 05 Sep 2022 16:29:19 +0000 Subject: [PATCH] test: autogenerate js types --- --- /dev/null +++ b/.github/workflows/autogen-js-types.yml @@ -0,0 +1,93 @@ +name: yarn autogetn JS types + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: + - develop + types: + - opened + - reopened + - synchronize #commit(s) pushed to the pull request + - ready_for_review + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +#Define Workflow variables +env: + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + autogen_js_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: "opal" + features: "opal-runtime" + - network: "quartz" + features: "quartz-runtime" + - network: "unique" + features: "unique-runtime" + + 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@v1.0.2 + + - 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 }} + FEATURE=${{ matrix.features }} + + + - name: Show build configuration + run: cat .docker/docker-compose.${{ matrix.network }}.yml + + - name: Build the stack + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Run tests + working-directory: tests + run: | + yarn polkadot-types + env: + RPC_URL: http://127.0.0.1:9933/ + + - name: Enumerate files after generation + working-directory: tests + run: ls -la + + - name: Stop running containers + if: always() # run this step always + run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down -- gitstuff