From 1cb4f1fbe343b1f05e349ee9d7020dcf28fee980 Mon Sep 17 00:00:00 2001 From: jaypan Date: Wed, 4 Sep 2024 12:39:45 +0200 Subject: [PATCH] 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 9283f71a..6434cbd0 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