From 37bdbec8f0294c44add05b5845bed54d8fca9549 Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 3 Sep 2024 14:48:29 +0200 Subject: [PATCH 01/21] Test the docker pack direct after CI --- .github/workflows/pr-check.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index c456a2971..a073f9fc4 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -29,7 +29,7 @@ jobs: - name: Checkout Sources (actions/checkout) uses: actions/checkout@v3 - - name: "[Ceck] cargo fmt" + - name: "[Check] cargo fmt" run: | cargo fmt --check @@ -40,3 +40,27 @@ jobs: - name: "[Check] cargo clippy" run: | cargo clippy --release -- -Dwarnings + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: "Extract metadata (tags, labels) for Docker" + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ secrets.DOCKER_REG_PARACHAIN }}-test + tags: | + type=ref,event=branch + type=ref,event=pr + + + - name: "Build and push" + uses: docker/build-push-action@v3 + with: + context: . + file: scripts/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} From f6ddafaf196538adda4a40857f4263b3738ff3c8 Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 3 Sep 2024 17:06:25 +0200 Subject: [PATCH 02/21] Speed up for testing docker image name --- .github/workflows/pr-check.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a073f9fc4..0a7f33622 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -53,14 +53,13 @@ jobs: with: images: ${{ secrets.DOCKER_REG_PARACHAIN }}-test tags: | - type=ref,event=branch type=ref,event=pr - + type=sha - name: "Build and push" uses: docker/build-push-action@v3 with: context: . - file: scripts/Dockerfile + file: scripts/Dockerfile.parachain-launch push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{github.head_ref}}-${{ steps.meta.outputs.tags }} From b066391deb3fa6a029d4658552fee7bdadc5a3a8 Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 3 Sep 2024 18:26:28 +0200 Subject: [PATCH 03/21] Update but should fail --- .github/workflows/brand-new-chain-test.yml | 100 +++++++++++++++++++++ .github/workflows/pr-check.yml | 2 +- 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/brand-new-chain-test.yml diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml new file mode 100644 index 000000000..fc3f3e769 --- /dev/null +++ b/.github/workflows/brand-new-chain-test.yml @@ -0,0 +1,100 @@ +name: Brand new chain test +# This workflow is triggered on dev branch manually or automatically after the Build and Publish workflow is completed +on: + workflow_dispatch: + workflow_run: + workflows: [Pull Request Check] + # types: [completed] + # branches: [dev] + +jobs: + brand-new-test: + runs-on: ubuntu-20.04 + steps: + - name: Clone simple CI + uses: GuillaumeFalourd/clone-github-repo-action@v2.3 + working-directory: ../ + with: + branch: main + owner: peaqnetwork + repository: simple-ci-poc + + - name: Setup ENV for the simple CI + working-directory: ../ + run: | + # Need to implement that + echo "WORK_DIRECTORY=$(realpath .)" >> $GITHUB_ENV + echo "PEAQ_NETWORK_NODE_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + echo "PEAQ_BC_TEST_BRANCH=$(realpath .)" >> $GITHUB_ENV + echo "PARACHAIN_LAUNCH_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + echo "RESULT_PATH=(realpath result)" >> $GITHUB_ENV + cat $GITHUB_ENV + mkdir -p result + # echo "FORKED_BINARY_FOLDER=(realpath ../forked-binary)" >> $GITHUB_ENV + + - name: Install dependencies bianry + working-directory: ../ + run: | + # Install git, default install + which git + # Install docker, default install + which docker + # Install docker-compose, default install? + which docker-compose + which docker compose + # Install nvm + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash + nvm install v16 + # Install yarn + npm install --global yarn + # Install jq + sudo apt-get install jq + # Install try-runtime + cargo install --git https://github.com/paritytech/try-runtime-cli --locked + # Install subkey + cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked + + - name: Clone peaq-bc-repo + uses: GuillaumeFalourd/clone-github-repo-action@v2.3 + working-directory: .. + with: + depth: 1 + branch: main # Should change the branch + owner: peaqnetwork + repository: peaq-bc-test + + - name: Install dependency on peaq-bc-test + working-directory: ../peaq-bc-test + run: | + python3 -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Clone parachain-launch + uses: GuillaumeFalourd/clone-github-repo-action@v2.3 + working-directory: .. + with: + branch: dev # Should change the branch + owner: peaqnetwork + repository: parachain-launch + + - name: Install dependency on parachain-launch + working-directory: ../parachain-launch + run: | + git submodule update --init --recursive + nvm install 16 + yarn build + yarn install + + - name: Install dependency on fork-off-substrate + working-directory: ../parachain-launch/fork-off-substrate + cd fork-off-substrate + npm install + + - name: Run simple CI + working-directory: ../simple-ci-poc + run: | + DATETIME=$(date '+%Y-%m-%d-%H-%M') + echo "Current DateTime: ${DATETIME}" + export SET_DATETIME=${DATETIME} + # [TODO] Use the docker image to regenerate the docker image... + bash new.chain.test.bash --chain peaq --test all diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 0a7f33622..baa4fa589 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -60,6 +60,6 @@ jobs: uses: docker/build-push-action@v3 with: context: . - file: scripts/Dockerfile.parachain-launch + file: scripts/Dockerfile push: true tags: ${{github.head_ref}}-${{ steps.meta.outputs.tags }} From 4777ceb7567c68bd2089134c3fd9d0e8bbca536e Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 3 Sep 2024 22:39:45 +0200 Subject: [PATCH 04/21] Fix the image tag --- .github/workflows/brand-new-chain-test.yml | 2 +- .github/workflows/pr-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index fc3f3e769..abc7cf40a 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -87,7 +87,7 @@ jobs: - name: Install dependency on fork-off-substrate working-directory: ../parachain-launch/fork-off-substrate - cd fork-off-substrate + run: | npm install - name: Run simple CI diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index baa4fa589..393497b2b 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -62,4 +62,4 @@ jobs: context: . file: scripts/Dockerfile push: true - tags: ${{github.head_ref}}-${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }} From 40cc1a76b43a670e8c4521a65deaf2020659950a Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 00:47:24 +0200 Subject: [PATCH 05/21] Stop the check for testing --- .github/workflows/brand-new-chain-test.yml | 11 ++++++++--- .github/workflows/pr-check.yml | 12 +++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index abc7cf40a..93c1e9702 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -1,11 +1,16 @@ name: Brand new chain test # This workflow is triggered on dev branch manually or automatically after the Build and Publish workflow is completed on: - workflow_dispatch: - workflow_run: - workflows: [Pull Request Check] + # workflow_dispatch: + # workflow_run: + # workflows: [Pull Request Check] # types: [completed] # branches: [dev] + pull_request: + types: + - opened + - synchronize + - closed jobs: brand-new-test: diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 393497b2b..7af491619 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -2,11 +2,13 @@ name: Pull Request Check on: - pull_request: - types: - - opened - - synchronize - - closed + workflow_dispatch: +# on: +# pull_request: +# types: +# - opened +# - synchronize +# - closed jobs: check: From 901c741d5c4d00ba51d441ece6a49cff3cc649e2 Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 12:24:28 +0200 Subject: [PATCH 06/21] Fix --- .github/workflows/brand-new-chain-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 93c1e9702..80cc54106 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -18,11 +18,11 @@ jobs: steps: - name: Clone simple CI uses: GuillaumeFalourd/clone-github-repo-action@v2.3 - working-directory: ../ with: branch: main owner: peaqnetwork repository: simple-ci-poc + path-to-clone: ../simple-ci-poc - name: Setup ENV for the simple CI working-directory: ../ From 108ef9c58bb9926417bf372bef015ed029baeb17 Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 12:25:41 +0200 Subject: [PATCH 07/21] Fix errro --- .github/workflows/brand-new-chain-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 80cc54106..9283f71a9 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -61,12 +61,12 @@ jobs: - name: Clone peaq-bc-repo uses: GuillaumeFalourd/clone-github-repo-action@v2.3 - working-directory: .. with: depth: 1 branch: main # Should change the branch owner: peaqnetwork repository: peaq-bc-test + path-to-clone: ../peaq-bc-test - name: Install dependency on peaq-bc-test working-directory: ../peaq-bc-test @@ -76,11 +76,11 @@ jobs: - name: Clone parachain-launch uses: GuillaumeFalourd/clone-github-repo-action@v2.3 - working-directory: .. with: branch: dev # Should change the branch owner: peaqnetwork repository: parachain-launch + path-to-clone: ../parachain-launch - name: Install dependency on parachain-launch working-directory: ../parachain-launch From 1cb4f1fbe343b1f05e349ee9d7020dcf28fee980 Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 12:39:45 +0200 Subject: [PATCH 08/21] Clone and move --- .github/workflows/brand-new-chain-test.yml | 101 ++++++++++++++------- 1 file changed, 66 insertions(+), 35 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 9283f71a9..6434cbd0e 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -20,53 +20,88 @@ jobs: uses: GuillaumeFalourd/clone-github-repo-action@v2.3 with: branch: main - owner: peaqnetwork + owner: sfffaaa repository: simple-ci-poc - path-to-clone: ../simple-ci-poc + + - name: Clone peaq-bc-repo + uses: GuillaumeFalourd/clone-github-repo-action@v2.3 + with: + depth: 1 + branch: main # Should change the branch + owner: peaqnetwork + repository: peaq-bc-test + + - name: Clone parachain-launch + uses: GuillaumeFalourd/clone-github-repo-action@v2.3 + with: + branch: dev # Should change the branch + owner: peaqnetwork + repository: parachain-launch + + - name: Move to project to correct place + run: | + mv simple-ci-poc ../ + mv peaq-bc-test ../ + mv parachain-launch ../ - name: Setup ENV for the simple CI working-directory: ../ run: | + mkdir -p result + pwd + ls . # Need to implement that - echo "WORK_DIRECTORY=$(realpath .)" >> $GITHUB_ENV + echo "WORK_DIRECTORY=$(pwd)" >> $GITHUB_ENV echo "PEAQ_NETWORK_NODE_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV - echo "PEAQ_BC_TEST_BRANCH=$(realpath .)" >> $GITHUB_ENV + echo "PEAQ_BC_TEST_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV echo "PARACHAIN_LAUNCH_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV - echo "RESULT_PATH=(realpath result)" >> $GITHUB_ENV + echo "RESULT_PATH=$(realpath result)" >> $GITHUB_ENV cat $GITHUB_ENV - mkdir -p result # echo "FORKED_BINARY_FOLDER=(realpath ../forked-binary)" >> $GITHUB_ENV - name: Install dependencies bianry working-directory: ../ + shell: bash run: | # Install git, default install - which git + git --version # Install docker, default install - which docker + docker --version + # Install docker-compose, default install? - which docker-compose - which docker compose + sudo apt-get update + sudo apt-get install ca-certificates curl + sudo install -m 0755 -d /etc/apt/keyrings + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + sudo chmod a+r /etc/apt/keyrings/docker.asc + + # Add the repository to Apt sources: + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + sudo apt-get install docker-compose-plugin + + alias docker-compose='docker compose' + docker compose version + # Install nvm - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash + # Already installed + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion nvm install v16 + nvm use v16 + # Install yarn npm install --global yarn # Install jq sudo apt-get install jq - # Install try-runtime - cargo install --git https://github.com/paritytech/try-runtime-cli --locked - # Install subkey - cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked - - - name: Clone peaq-bc-repo - uses: GuillaumeFalourd/clone-github-repo-action@v2.3 - with: - depth: 1 - branch: main # Should change the branch - owner: peaqnetwork - repository: peaq-bc-test - path-to-clone: ../peaq-bc-test + # # Install try-runtime, in this test, we won't use that + # cargo install --git https://github.com/paritytech/try-runtime-cli --locked + # # Install subkey, in this test, we won't use that + # cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked - name: Install dependency on peaq-bc-test working-directory: ../peaq-bc-test @@ -74,21 +109,16 @@ jobs: python3 -m pip install --upgrade pip pip install -r requirements.txt - - name: Clone parachain-launch - uses: GuillaumeFalourd/clone-github-repo-action@v2.3 - with: - branch: dev # Should change the branch - owner: peaqnetwork - repository: parachain-launch - path-to-clone: ../parachain-launch - - name: Install dependency on parachain-launch working-directory: ../parachain-launch run: | git submodule update --init --recursive - nvm install 16 - yarn build + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + nvm use v16 yarn install + yarn build - name: Install dependency on fork-off-substrate working-directory: ../parachain-launch/fork-off-substrate @@ -102,4 +132,5 @@ jobs: echo "Current DateTime: ${DATETIME}" export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... - bash new.chain.test.bash --chain peaq --test all + # Need to check several things + bash -x new.chain.test.bash --chain peaq --test all From 51a9822a22b5cf7584733dcbeb3013747ac27d5b Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 15:24:16 +0200 Subject: [PATCH 09/21] Build directly --- .github/workflows/brand-new-chain-test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 6434cbd0e..bf1485d89 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -125,6 +125,22 @@ jobs: run: | npm install + - name: "Free Disk Space (insightsengineering/disk-space-reclaimer)" + uses: insightsengineering/disk-space-reclaimer@v1.1.0 + + - name: "Linux Tools" + run: sudo apt install -y cmake pkg-config libssl-dev build-essential clang libclang-dev curl protobuf-compiler + + - name: "Rust" + run: | + TLCHN=nightly-2024-01-21 + curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $TLCHN + rustup target add wasm32-unknown-unknown --toolchain $TLCHN + cargo install cargo-expand --locked --version 1.0.71 + + - name: Checkout Sources (actions/checkout) + uses: actions/checkout@v3 + - name: Run simple CI working-directory: ../simple-ci-poc run: | From ee4f44824903f1701432d37104453026a726e62d Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 16:15:44 +0200 Subject: [PATCH 10/21] Remove storage --- .github/workflows/brand-new-chain-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index bf1485d89..8a53601c1 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -56,6 +56,7 @@ jobs: echo "PEAQ_BC_TEST_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV echo "PARACHAIN_LAUNCH_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV echo "RESULT_PATH=$(realpath result)" >> $GITHUB_ENV + echo "GLOBAL_VENV=true" >> $GITHUB_ENV cat $GITHUB_ENV # echo "FORKED_BINARY_FOLDER=(realpath ../forked-binary)" >> $GITHUB_ENV @@ -108,6 +109,7 @@ jobs: run: | python3 -m pip install --upgrade pip pip install -r requirements.txt + pip install eth-typing==3.5.2 - name: Install dependency on parachain-launch working-directory: ../parachain-launch @@ -125,8 +127,8 @@ jobs: run: | npm install - - name: "Free Disk Space (insightsengineering/disk-space-reclaimer)" - uses: insightsengineering/disk-space-reclaimer@v1.1.0 + # - name: "Free Disk Space (insightsengineering/disk-space-reclaimer)" + # uses: insightsengineering/disk-space-reclaimer@v1.1.0 - name: "Linux Tools" run: sudo apt install -y cmake pkg-config libssl-dev build-essential clang libclang-dev curl protobuf-compiler From 3355a76989d1f2d2e72187d2bdca66234bcc21f8 Mon Sep 17 00:00:00 2001 From: jaypan Date: Thu, 5 Sep 2024 04:21:37 +0200 Subject: [PATCH 11/21] Test peaq-dev/peaq --- .github/workflows/brand-new-chain-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 8a53601c1..b549c4937 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -151,4 +151,5 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things + bash -x new.chain.test.bash --chain peaq-dev --test all bash -x new.chain.test.bash --chain peaq --test all From 5355bf802afabba0e689f2e5462da663ab18bc0f Mon Sep 17 00:00:00 2001 From: jaypan Date: Thu, 5 Sep 2024 10:54:45 +0200 Subject: [PATCH 12/21] Remove the peaq test --- .github/workflows/brand-new-chain-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index b549c4937..24e1e3f2b 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -152,4 +152,3 @@ jobs: # [TODO] Use the docker image to regenerate the docker image... # Need to check several things bash -x new.chain.test.bash --chain peaq-dev --test all - bash -x new.chain.test.bash --chain peaq --test all From 895fd3cf95b679f39a9758c538fe1d108dd0a406 Mon Sep 17 00:00:00 2001 From: jaypan Date: Fri, 6 Sep 2024 09:25:25 +0200 Subject: [PATCH 13/21] Update the branch to test --- .github/workflows/brand-new-chain-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 24e1e3f2b..1b59277c9 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -26,8 +26,7 @@ jobs: - name: Clone peaq-bc-repo uses: GuillaumeFalourd/clone-github-repo-action@v2.3 with: - depth: 1 - branch: main # Should change the branch + branch: feat/1207852356564241_improve # Should change the branch owner: peaqnetwork repository: peaq-bc-test From fd341232223eb3b3cdc4f22ce0052f3cb77dd7e8 Mon Sep 17 00:00:00 2001 From: jaypan Date: Fri, 6 Sep 2024 10:04:38 +0200 Subject: [PATCH 14/21] Test the fail func --- .github/workflows/brand-new-chain-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 1b59277c9..64babbfcb 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -150,4 +150,5 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - bash -x new.chain.test.bash --chain peaq-dev --test all + bash -x new.chain.test.bash --chain peaq-dev --test "test_booststrap" + bash -x new.chain.test.bash --chain peaq-dev --test "test_rbac_bridge" From 295e50c8b90a08b85bd41aeeb4293715f5dce17a Mon Sep 17 00:00:00 2001 From: jaypan Date: Fri, 6 Sep 2024 12:48:08 +0200 Subject: [PATCH 15/21] Add cache --- .github/workflows/brand-new-chain-test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 64babbfcb..910f34304 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -142,6 +142,19 @@ jobs: - name: Checkout Sources (actions/checkout) uses: actions/checkout@v3 + - name: Set up cargo cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Run simple CI working-directory: ../simple-ci-poc run: | From 035bd186404d379be579adb1f7c09a30ad877cf3 Mon Sep 17 00:00:00 2001 From: jaypan Date: Fri, 6 Sep 2024 22:31:18 +0200 Subject: [PATCH 16/21] Test all --- .github/workflows/brand-new-chain-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 910f34304..437d69be3 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -163,5 +163,4 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - bash -x new.chain.test.bash --chain peaq-dev --test "test_booststrap" - bash -x new.chain.test.bash --chain peaq-dev --test "test_rbac_bridge" + bash -x new.chain.test.bash --chain peaq-dev --test all From 4c890a75c8a5dba3ba5226ee38155642cb1c4c11 Mon Sep 17 00:00:00 2001 From: jaypan Date: Sat, 7 Sep 2024 08:54:42 +0200 Subject: [PATCH 17/21] Remove cache --- .github/workflows/brand-new-chain-test.yml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 437d69be3..35815ac38 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -142,18 +142,18 @@ jobs: - name: Checkout Sources (actions/checkout) uses: actions/checkout@v3 - - name: Set up cargo cache - uses: actions/cache@v3 - continue-on-error: false - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + # - name: Set up cargo cache + # uses: actions/cache@v3 + # continue-on-error: false + # with: + # path: | + # ~/.cargo/bin/ + # ~/.cargo/registry/index/ + # ~/.cargo/registry/cache/ + # ~/.cargo/git/db/ + # target/ + # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + # restore-keys: ${{ runner.os }}-cargo- - name: Run simple CI working-directory: ../simple-ci-poc From 4040359cb3a93e3121434d7f8c354c445a07e8ce Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 10 Sep 2024 17:59:37 +0200 Subject: [PATCH 18/21] Focus on one test now --- .github/workflows/brand-new-chain-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 35815ac38..531873183 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -163,4 +163,4 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - bash -x new.chain.test.bash --chain peaq-dev --test all + bash -x new.chain.test.bash --chain peaq-dev --test "test_from_relay_to_peaq" From 3dbe50ef1627180692b6c901a5052e6c9d0736d4 Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 10 Sep 2024 18:19:19 +0200 Subject: [PATCH 19/21] Add the maunual input --- .github/workflows/brand-new-chain-test.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 531873183..e1a5c7fd8 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -1,7 +1,18 @@ name: Brand new chain test # This workflow is triggered on dev branch manually or automatically after the Build and Publish workflow is completed on: - # workflow_dispatch: + workflow_dispatch: + inputs: + chain: + description: 'Chain to test' + required: true + default: 'peaq-dev' + type: string + testcases: + description: 'Test to run' + required: true + default: 'all' + type: string # workflow_run: # workflows: [Pull Request Check] # types: [completed] @@ -163,4 +174,4 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - bash -x new.chain.test.bash --chain peaq-dev --test "test_from_relay_to_peaq" + bash -x new.chain.test.bash --chain ${{ github.event.inputs.chain }} --test ${{ github.event.inputs.testcases }} From 21d0a0cb679920a452e3ec1d4fba02a178215f10 Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 10 Sep 2024 18:43:57 +0200 Subject: [PATCH 20/21] Try --- .github/workflows/brand-new-chain-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index e1a5c7fd8..3bd6b1e99 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -27,6 +27,10 @@ jobs: brand-new-test: runs-on: ubuntu-20.04 steps: + - name: Show the inputs + run: | + echo "Chain: ${{ github.event.inputs.chain }}" + echo "Testcases: ${{ github.event.inputs.testcases }}" - name: Clone simple CI uses: GuillaumeFalourd/clone-github-repo-action@v2.3 with: @@ -174,4 +178,6 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - bash -x new.chain.test.bash --chain ${{ github.event.inputs.chain }} --test ${{ github.event.inputs.testcases }} + chain=${{ github.event.inputs.chain }} || "peaq-dev" + testcases=${{ github.event.inputs.testcases }} || "all" + bash -x new.chain.test.bash --chain $chain --test $testcases From e3ca680c6093c12b4573d5ab083abc667903bb4a Mon Sep 17 00:00:00 2001 From: jaypan Date: Tue, 10 Sep 2024 19:13:16 +0200 Subject: [PATCH 21/21] Test --- .github/workflows/brand-new-chain-test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/brand-new-chain-test.yml b/.github/workflows/brand-new-chain-test.yml index 3bd6b1e99..f89f26f53 100644 --- a/.github/workflows/brand-new-chain-test.yml +++ b/.github/workflows/brand-new-chain-test.yml @@ -178,6 +178,4 @@ jobs: export SET_DATETIME=${DATETIME} # [TODO] Use the docker image to regenerate the docker image... # Need to check several things - chain=${{ github.event.inputs.chain }} || "peaq-dev" - testcases=${{ github.event.inputs.testcases }} || "all" - bash -x new.chain.test.bash --chain $chain --test $testcases + bash -x new.chain.test.bash --chain peaq-dev --test all