git.delta.rocks / unique-network / refs/commits / 997ec5a7e5e6

difftreelog

Revert "tests: separate unit tests into own workflow. apply for master and develop branches."

Alexander Aksenov2022-08-22parent: #d9cdcfb.patch.diff
in: master
This reverts commit d9cdcfb1a400d66c225ec9072178b1398170e9c4.

5 files changed

modified.docker/Dockerfile-chain-dev-unitdiffbeforeafterboth
--- a/.docker/Dockerfile-chain-dev-unit
+++ b/.docker/Dockerfile-chain-dev-unit
@@ -23,4 +23,4 @@
 
 WORKDIR /dev_chain
 
-CMD cargo test --features=limit-testing
+RUN cargo test --features=limit-testing
modified.envdiffbeforeafterboth
--- a/.env
+++ b/.env
@@ -7,9 +7,6 @@
 KUSAMA_MAINNET_BRANCH=release-v0.9.26
 QUARTZ_MAINNET_TAG=quartz-v924012-2
 
-UNQWND_MAINNET_BRANCH=release-v0.9.24
-
 OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443
 QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443
 UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443
-
modified.github/workflows/codestyle.ymldiffbeforeafterboth
--- a/.github/workflows/codestyle.yml
+++ b/.github/workflows/codestyle.yml
@@ -49,7 +49,7 @@
         run: cargo fmt -- --check   # In that mode it returns only exit code.
       - name: Cargo fmt state
         if: success()
-        run: echo "Nothing to do. Cargo fmt check - returned exit code 0."
+        run: echo "Nothing to do. Cargo fmt returned exit code 0."
 
 
   clippy:
modified.github/workflows/dev-build-tests.ymldiffbeforeafterboth
--- a/.github/workflows/dev-build-tests.yml
+++ b/.github/workflows/dev-build-tests.yml
@@ -125,3 +125,64 @@
         run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
 
 
+  dev_build_unit_test:
+    # The type of runner that the job will run on
+    runs-on: [self-hosted-ci,medium]
+    timeout-minutes: 1380
+
+    name: unit tests
+
+
+    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.
+
+
+    steps:
+      - name: Skip if pull request is in Draft
+        # `if: github.event.pull_request.draft == true` should be kept here, at
+        # the step level, rather than at the job level. The latter is not
+        # recommended because when the PR is moved from "Draft" to "Ready to
+        # review" the workflow will immediately be passing (since it was skipped),
+        # even though it hasn't actually ran, since it takes a few seconds for
+        # the workflow to start. This is also disclosed in:
+        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/17
+        # That scenario would open an opportunity for the check to be bypassed:
+        # 1. Get your PR approved
+        # 2. Move it to Draft
+        # 3. Push whatever commits you want
+        # 4. Move it to "Ready for review"; now the workflow is passing (it was
+        #    skipped) and "Check reviews" is also passing (it won't be updated
+        #    until the workflow is finished)
+        if: github.event.pull_request.draft == true
+        run: exit 1
+
+      - 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-unit.j2
+          output_file: .docker/docker-compose.unit.yml
+          variables: |
+            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+            FEATURE=${{ matrix.features }}
+    
+
+      - name: Show build configuration
+        run: cat .docker/docker-compose.unit.yml
+
+      - name: Build the stack
+        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up -d --build --remove-orphans
+
+
+      - name: Stop running containers
+        if: always()                   # run this step always
+        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down
deleted.github/workflows/unit-tests.ymldiffbeforeafterboth
before · .github/workflows/unit-tests.yml
1name: yarn test23# Controls when the action will run.4on:5 # Triggers the workflow on push or pull request events but only for the master branch6  pull_request:7    branches:8      - develop9      - master10    types:11      - opened12      - reopened13      - synchronize   #commit(s) pushed to the pull request14      - ready_for_review1516  # Allows you to run this workflow manually from the Actions tab17  workflow_dispatch:1819#Define Workflow variables20env:21  REPO_URL: ${{ github.server_url }}/${{ github.repository }}2223concurrency: 24  group: ${{ github.workflow }}-${{ github.ref }}25  cancel-in-progress: true2627# A workflow run is made up of one or more jobs that can run sequentially or in parallel28jobs:2930  unit_tests:31    # The type of runner that the job will run on32    runs-on: [self-hosted-ci,medium]33    timeout-minutes: 13803435    name: unit tests363738    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.394041    steps:42      - name: Skip if pull request is in Draft43        # `if: github.event.pull_request.draft == true` should be kept here, at44        # the step level, rather than at the job level. The latter is not45        # recommended because when the PR is moved from "Draft" to "Ready to46        # review" the workflow will immediately be passing (since it was skipped),47        # even though it hasn't actually ran, since it takes a few seconds for48        # the workflow to start. This is also disclosed in:49        # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1750        # That scenario would open an opportunity for the check to be bypassed:51        # 1. Get your PR approved52        # 2. Move it to Draft53        # 3. Push whatever commits you want54        # 4. Move it to "Ready for review"; now the workflow is passing (it was55        #    skipped) and "Check reviews" is also passing (it won't be updated56        #    until the workflow is finished)57        if: github.event.pull_request.draft == true58        run: exit 15960      - 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@v365        with:66          ref: ${{ github.head_ref }}  #Checking out head commit6768      - name: Read .env file69        uses: xom9ikk/dotenv@v1.0.27071      - name: Generate ENV related extend file for docker-compose72        uses: cuchi/jinja2-action@v1.2.073        with:74          template: .docker/docker-compose.tmp-unit.j275          output_file: .docker/docker-compose.unit.yml76          variables: |77            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}78            FEATURE=${{ matrix.features }}79    8081      - name: Show build configuration82        run: cat .docker/docker-compose.unit.yml8384      - name: Build the stack85        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" up --build  --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev8687      - name: Stop running containers88        if: always()                   # run this step always89        run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.unit.yml" down