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

difftreelog

Merge pull request #926 from UniqueNetwork/ci/fix_env

Yaroslav Bolyukin2023-04-28parents: #9f5b0cc #fedfe1a.patch.diff
in: master
delete variable POLKADOT_BUILD_BRANCH from .env in CI

6 files changed

modified.docker/Dockerfile-parachain-upgrade-data.j2diffbeforeafterboth
--- a/.docker/Dockerfile-parachain-upgrade-data.j2
+++ b/.docker/Dockerfile-parachain-upgrade-data.j2
@@ -1,4 +1,3 @@
-ARG POLKADOT_BUILD_BRANCH
 FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot
 
 # ===== Rust builder =====
modified.docker/Dockerfile-parachain-upgrade.j2diffbeforeafterboth
--- a/.docker/Dockerfile-parachain-upgrade.j2
+++ b/.docker/Dockerfile-parachain-upgrade.j2
@@ -1,4 +1,3 @@
-ARG POLKADOT_BUILD_BRANCH
 FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot
 
 # ===== Rust builder =====
modified.envdiffbeforeafterboth
--- a/.env
+++ b/.env
@@ -1,5 +1,4 @@
 RUST_TOOLCHAIN=nightly-2022-11-15
-POLKADOT_BUILD_BRANCH=release-v0.9.37
 POLKADOT_LAUNCH_BRANCH=unique-network
 RELAY_CHAIN_TYPE=westend
 
modified.github/workflows/collator-selection.ymldiffbeforeafterboth
--- a/.github/workflows/collator-selection.yml
+++ b/.github/workflows/collator-selection.yml
@@ -67,7 +67,7 @@
           output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml
           variables: |
             RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
-            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+            POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
             POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
             NETWORK=${{ matrix.network }}
             BRANCH=${{ github.head_ref }}
modified.github/workflows/market-test.ymldiffbeforeafterboth
--- a/.github/workflows/market-test.yml
+++ b/.github/workflows/market-test.yml
@@ -11,7 +11,37 @@
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
 
+  prepare-execution-marix:
+
+    name: Prepare execution matrix
+
+    runs-on: [self-hosted-ci]
+    outputs:
+      matrix: ${{ steps.create_matrix.outputs.matrix }}
+
+    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.1.0
+        with:
+          ref: ${{ github.head_ref }}  #Checking out head commit
+
+      - name: Read .env file
+        uses: xom9ikk/dotenv@v2
+
+      - name: Create Execution matrix
+        uses: CertainLach/create-matrix-action@v4
+        id: create_matrix
+        with:
+          matrix: |
+            network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
+
+
   market_test:
+    needs: prepare-execution-marix
     # The type of runner that the job will run on
     runs-on: [self-hosted-ci,large]
     timeout-minutes: 360
@@ -22,8 +52,7 @@
     
     strategy:
       matrix:
-        include:
-          - network: "opal"
+        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
 
     steps:
       - name: Clean Workspace
@@ -58,7 +87,7 @@
           variables: |
             REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
             RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
-            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+            POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
             POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
             NETWORK=${{ matrix.network }}
             BRANCH=${{ github.head_ref }}
modified.github/workflows/testnet-build.ymldiffbeforeafterboth
before · .github/workflows/testnet-build.yml
1name: testnet-image-build23# Controls when the action will run.4on:5  workflow_call:6  7  # Allows you to run this workflow manually from the Actions tab8  workflow_dispatch:910#Define Workflow variables11env:12  REPO_URL: ${{ github.server_url }}/${{ github.repository }}1314# A workflow run is made up of one or more jobs that can run sequentially or in parallel15jobs:1617  prepare-execution-marix:1819    name: Prepare execution matrix2021    runs-on: [self-hosted-ci,medium]22    outputs:23      matrix: ${{ steps.create_matrix.outputs.matrix }}2425    steps:2627      - name: Clean Workspace28        uses: AutoModality/action-clean@v1.1.02930      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it31      - uses: actions/checkout@v3.1.032        with:33          ref: ${{ github.head_ref }}  #Checking out head commit3435      - name: Read .env file36        uses: xom9ikk/dotenv@v23738      - name: Create Execution matrix39        uses: CertainLach/create-matrix-action@v440        id: create_matrix41        with:42          matrix: |43            network {opal}44            network {quartz}45            network {unique}4647  testnet-build:48    needs: prepare-execution-marix49    # The type of runner that the job will run on50    runs-on: [self-hosted-ci,medium]5152    timeout-minutes: 6005354    name: ${{ matrix.network }}5556    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.5758    strategy:59      matrix:60        include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}6162    steps:63      - name: Skip if pull request is in Draft64        if: github.event.pull_request.draft == true65        run: exit 16667      - name: Clean Workspace68        uses: AutoModality/action-clean@v1.1.06970      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it71      - uses: actions/checkout@v3.1.072        with:73          ref: ${{ github.head_ref }}  #Checking out head commit7475      - name: Read .env file76        uses: xom9ikk/dotenv@v27778      - name: Generate ENV related extend file for docker-compose79        uses: cuchi/jinja2-action@v1.2.080        with:81          template: .docker/Dockerfile-testnet.j282          output_file: .docker/Dockerfile-testnet.${{ matrix.network }}.yml83          variables: |84            RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}85            NETWORK=${{ matrix.network }}86            POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}87            POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}88            NETWORK=${{ matrix.network }}89            BRANCH=${{ github.head_ref }}9091      - name: Show build configuration92        run: cat .docker/Dockerfile-testnet.${{ matrix.network }}.yml9394      - name: Show launch-config configuration95        run: cat launch-config.json9697      - name: Run find-and-replace to remove slashes from branch name98        uses: mad9000/actions-find-and-replace-string@499        id: branchname100        with:101          source: ${{ github.head_ref }}102          find: '/'103          replace: '-'104105      - name: Log in to Docker Hub106        uses: docker/login-action@v2.1.0107        with:108          username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}109          password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}110111      - name: Pull polkadot docker image112        run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}           113114      - name: Build the stack115        run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} . 116117      - name: Push docker version image118        run: docker push uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}119120      - name: Clean Workspace121        if: always()122        uses: AutoModality/action-clean@v1.1.0123124      - name: Remove builder cache125        if: always()                   # run this step always126        run: |127          docker builder prune -f128          docker system prune -f