difftreelog
Merge pull request #926 from UniqueNetwork/ci/fix_env
in: master
delete variable POLKADOT_BUILD_BRANCH from .env in CI
6 files changed
.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 =====
.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 =====
.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
.github/workflows/collator-selection.ymldiffbeforeafterboth1name: collator-selection-test-run23# Triger: only call from main workflow(re-usable workflows)4on:5 workflow_call:67# A workflow run is made up of one or more jobs that can run sequentially or in parallel8jobs:9 execution-marix:10 name: Prepare execution matrix1112 runs-on: self-hosted-ci13 outputs:14 matrix: ${{ steps.create_matrix.outputs.matrix }}1516 steps:1718 - name: Clean Workspace19 uses: AutoModality/action-clean@v1.1.02021 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it22 - uses: actions/checkout@v323 with:24 ref: ${{ github.head_ref }} #Checking out head commit2526 - name: Read .env file27 uses: xom9ikk/dotenv@v22829 - name: Create Execution matrix30 uses: CertainLach/create-matrix-action@v331 id: create_matrix32 with:33 matrix: |34 network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}35 network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}36 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}3738 collator-selection:39 needs: execution-marix40 # The type of runner that the job will run on41 runs-on: [self-hosted-ci,large]42 timeout-minutes: 13804344 name: ${{ matrix.network }}45 strategy:46 matrix:47 include: ${{fromJson(needs.execution-marix.outputs.matrix)}}4849 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.5051 steps:52 - name: Clean Workspace53 uses: AutoModality/action-clean@v1.1.05455 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it56 - uses: actions/checkout@v357 with:58 ref: ${{ github.head_ref }} #Checking out head commit5960 - name: Read .env file61 uses: xom9ikk/dotenv@v26263 - name: Generate ENV related extend file for docker-compose64 uses: cuchi/jinja2-action@v1.2.065 with:66 template: .docker/docker-compose.tmp-collators.j267 output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml68 variables: |69 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}70 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}71 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}72 NETWORK=${{ matrix.network }}73 BRANCH=${{ github.head_ref }}7475 - name: Show build configuration76 run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml7778 - name: Show launch-config configuration79 run: cat launch-config.json8081 - name: Build the stack82 run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 3008384 # 🚀 POLKADOT LAUNCH COMPLETE 🚀85 - name: Check if docker logs consist messages related to testing of collator tests 86 if: success()87 run: |88 counter=16089 function check_container_status {90 docker inspect -f {{.State.Running}} parachain-collators91 }92 function do_docker_logs {93 docker logs --details parachain-collators 2>&194 }95 function is_started {96 if [ "$(check_container_status)" == "true" ]; then97 echo "Container: collator-${{ matrix.network }}-testnet-local RUNNING";98 echo "Check Docker logs"99 DOCKER_LOGS=$(do_docker_logs)100 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then101 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"102 return 0103 else104 echo "Message not found in logs output, repeating..."105 return 1106 fi107 else108 echo "Container collator-${{ matrix.network }}-testnet-local NOT RUNNING"109 echo "Halting all future checks"110 exit 1111 fi112 echo "something goes wrong"113 exit 1114 }115 while ! is_started; do116 echo "Waiting for special message in log files "117 sleep 30s118 counter=$(( $counter - 1 ))119 echo "Counter: $counter"120 if [ "$counter" -gt "0" ]; then121 continue122 else123 break124 fi125 done126 echo "Halting script"127 exit 0128 shell: bash129130 - uses: actions/setup-node@v3131 with:132 node-version: 16133134 - name: Run Collator tests135 working-directory: tests136 if: success() || failure()137 run: |138 yarn install139 yarn add mochawesome140 node scripts/readyness.js141 echo "Ready to start tests"142 yarn polkadot-types143 NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}144 env:145 RPC_URL: http://127.0.0.1:9933/146147 - name: Test Report Collator148 uses: phoenix-actions/test-reporting@v8149 id: test-report-collator150 if: success() || failure() # run this step even if previous step failed151 with:152 name: Report Collator tests results - ${{ matrix.network }} # Name of the check run which will be created153 path: tests/mochawesome-report/test-collators-*.json # Path to test results154 reporter: mochawesome-json155 fail-on-error: 'false'156157 - name: Stop running containers158 if: always() # run this step always159 run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" down160161 - name: Remove builder cache162 if: always() # run this step always163 run: |164 docker builder prune -f -a165 docker system prune -f.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 }}
.github/workflows/testnet-build.ymldiffbeforeafterboth--- a/.github/workflows/testnet-build.yml
+++ b/.github/workflows/testnet-build.yml
@@ -40,9 +40,9 @@
id: create_matrix
with:
matrix: |
- network {opal}
- network {quartz}
- network {unique}
+ network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
+ network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
+ network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}
testnet-build:
needs: prepare-execution-marix
@@ -83,7 +83,7 @@
variables: |
RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
NETWORK=${{ matrix.network }}
- 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 }}
@@ -109,7 +109,7 @@
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Pull polkadot docker image
- run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+ run: docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
- name: Build the stack
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 }} .