From 4353ec4d20f15e67370273a0aca4c0893e572fce Mon Sep 17 00:00:00 2001 From: Alex Todorov Date: Fri, 12 Jan 2024 10:48:31 +0200 Subject: [PATCH] DEBUG: Try Node.js 20 like Creditcoin3 --- .github/workflows/bench.yml | 276 +++++++ .github/workflows/check-runtime-changes.yml | 31 + .github/workflows/ci.yml | 817 ++++++++++++++++++++ .github/workflows/codeql.yml | 73 ++ .github/workflows/deploy-docs.yml | 40 + .github/workflows/extrinsics.yml | 72 +- .github/workflows/llvm-cov.yml | 102 +++ .github/workflows/mega-linter.yml | 81 ++ .github/workflows/release.yml | 267 +++++++ .github/workflows/runtime-upgrade.yml | 752 ++++++++++++++++++ .github/workflows/runtime.yml | 73 ++ Dockerfile | 2 +- 12 files changed, 2584 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 155e0c0d55..420955bf7c 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,276 +1,552 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: BENCHMARK +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Controls when the action will run. +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [testnet] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ RUNNER_VM_NAME: "github-runner-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" +/node-version: 18/node-version: 20/ RESOURCE_GROUP: "github-runner-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" +/node-version: 18/node-version: 20/ AZ_LOCATION: "westus3" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ check-if-needed: +/node-version: 18/node-version: 20/ # To avoid endless loop in CI skip this job on the commit which +/node-version: 18/node-version: 20/ # auto-updates the weights and is generated further below. +/node-version: 18/node-version: 20/ if: ${{ github.event_name == 'pull_request' && github.triggering_actor != 'notaturkey' }} +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ outputs: +/node-version: 18/node-version: 20/ needs-bench: ${{ steps.version-check.outputs.needs_bench }} +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check versions +/node-version: 18/node-version: 20/ id: version-check +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-spec-increase.sh "remotes/origin/$GITHUB_BASE_REF" "HEAD" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-benchmarks: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ needs: check-if-needed +/node-version: 18/node-version: 20/ if: needs.check-if-needed.outputs.needs-bench == 1 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Inspect benchmark CI config +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: Command below may differ depending on which workflow config file +/node-version: 18/node-version: 20/ # your job is defined in !!! Don't copy&paste it blindly !!! +/node-version: 18/node-version: 20/ PALLETS_IN_CI_CONFIG=$(grep "PALLET:" .github/workflows/bench.yml | grep -v PALLETS_IN_CI_CONFIG | tr -d ' ' | cut -f2 -d: | sort | xargs) +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ PALLETS_IN_SOURCE=$(./scripts/check-parity-bw-extrinsics-benchmarks-weights.sh --show-pallets) +/node-version: 18/node-version: 20/ if [ "$PALLETS_IN_CI_CONFIG" != "$PALLETS_IN_SOURCE" ]; then +/node-version: 18/node-version: 20/ echo "FAIL: Pallet mismatch between source code and benchmark CI config" +/node-version: 18/node-version: 20/ echo "INFO: in source: '$PALLETS_IN_SOURCE'" +/node-version: 18/node-version: 20/ echo "INFO: CI config: '$PALLETS_IN_CI_CONFIG'" +/node-version: 18/node-version: 20/ exit 1 +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build benchmarks +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release --features runtime-benchmarks +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload benchmark binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ deploy-github-runner: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ needs: build-benchmarks +/node-version: 18/node-version: 20/ outputs: +/node-version: 18/node-version: 20/ runner_vm_name: ${{ steps.get-env.outputs.runner_vm_name }} +/node-version: 18/node-version: 20/ resource_group: ${{ steps.get-env.outputs.resource_group }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install azure-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt remove azure-cli -y && sudo apt autoremove -y +/node-version: 18/node-version: 20/ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +/node-version: 18/node-version: 20/ sudo apt install -y jq +/node-version: 18/node-version: 20/ az version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Authorize hosted-runner +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ mkdir -p ~/.ssh/ +/node-version: 18/node-version: 20/ ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa +/node-version: 18/node-version: 20/ cat ~/.ssh/id_rsa.pub >> .github/authorized_keys +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Evaluate env vars +/node-version: 18/node-version: 20/ id: get-env +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: using env.RUNNER_VM_NAME directly in job outputs above +/node-version: 18/node-version: 20/ # doesn't evaluate the $GITHUB_RUN_ID reference +/node-version: 18/node-version: 20/ echo "runner_vm_name=${{ env.RUNNER_VM_NAME }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "resource_group=${{ env.RESOURCE_GROUP }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Provision VM +/node-version: 18/node-version: 20/ if: env.LC_GITHUB_REPO_ADMIN_TOKEN +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "INFO: From ENVs: RUNNER_VM_NAME=${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ echo "INFO: From Step: RUNNER_VM_NAME=${{ steps.get-env.outputs.runner_vm_name }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ az login --service-principal --username "${{ secrets.AZURE_APP_ID }}" --password "${{ secrets.AZURE_APP_PASSWORD }}" --tenant "${{ secrets.AZURE_TENANT_ID }}" +/node-version: 18/node-version: 20/ az account set --subscription "Playground Subscription" +/node-version: 18/node-version: 20/ ## az account set -s "${{ secrets.AZURE_SUBSCRIPTION_ID }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # create resource group +/node-version: 18/node-version: 20/ echo "INFO: ${{ steps.get-env.outputs.resource_group }}" +/node-version: 18/node-version: 20/ az group create -n "${{ steps.get-env.outputs.resource_group }}" --location "${{ env.AZ_LOCATION }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # RG Creditcoin-Test is in WestUS and the CPU quota is already full +/node-version: 18/node-version: 20/ # that's why specify a different region here +/node-version: 18/node-version: 20/ az deployment group create -g "${{ steps.get-env.outputs.resource_group }}" -f .github/runner.bicep \ +/node-version: 18/node-version: 20/ --parameters location="${{ env.AZ_LOCATION }}" \ +/node-version: 18/node-version: 20/ --parameters vmName="${{ steps.get-env.outputs.runner_vm_name }}" \ +/node-version: 18/node-version: 20/ --parameters adminPasswordOrKey="$(cat .github/authorized_keys)" > output.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # provision the GitHub Runner binary on the VM +/node-version: 18/node-version: 20/ # passing additional ENV values +/node-version: 18/node-version: 20/ SSH_USER_AT_HOSTNAME=$(jq -r '.properties.outputs.sshUserAtHostname.value' < output.json) +/node-version: 18/node-version: 20/ echo "INFO: $SSH_USER_AT_HOSTNAME" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ export LC_RUNNER_VM_NAME="${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ ssh -i ~/.ssh/id_rsa \ +/node-version: 18/node-version: 20/ -o SendEnv=LC_GITHUB_REPO_ADMIN_TOKEN,LC_RUNNER_VM_NAME \ +/node-version: 18/node-version: 20/ -o StrictHostKeyChecking=no "$SSH_USER_AT_HOSTNAME" < ./scripts/provision-github-runner.sh +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ LC_GITHUB_REPO_ADMIN_TOKEN: ${{ secrets.GH_REPO_ADMIN_TOKEN }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ hardware-benchmarks: +/node-version: 18/node-version: 20/ # see https://gist.github.com/jonico/a94d03cac7a858e0613926d9f1bc7f2b +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ # checkov:skip=CKV2_GHA_1:We need this for weights auto-update +/node-version: 18/node-version: 20/ permissions: write-all +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 10 +/node-version: 18/node-version: 20/ repository: ${{ github.event.pull_request.head.repo.full_name }} +/node-version: 18/node-version: 20/ ref: ${{ github.event.pull_request.head.ref }} +/node-version: 18/node-version: 20/ token: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set env +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "HOME=/home/actions" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download benchmark binary +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Restore executable permissions +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check if runner machine meets chain's requirements +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-hardware.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Run creditcoin pallet with lesser steps +/node-version: 18/node-version: 20/ - name: Creditcoin +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ continue-on-error: false +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ STEPS: 8 +/node-version: 18/node-version: 20/ REPEAT: 8 +/node-version: 18/node-version: 20/ PALLET: creditcoin +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p "$PALLET" -b -r "$REPEAT" -s "$STEPS" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Offchain Task Scheduler +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ continue-on-error: false +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ PALLET: offchain_task_scheduler +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p "$PALLET" -b +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Rewards +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ continue-on-error: false +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ PALLET: rewards +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p "$PALLET" -b +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Commit changes to current branch +/node-version: 18/node-version: 20/ uses: EndBug/add-and-commit@v9 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ author_name: gluwa-bot +/node-version: 18/node-version: 20/ author_email: creditcoin@gluwa.com +/node-version: 18/node-version: 20/ message: "Auto-update pallet weights" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Prepare commit for PR against dev +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ LAST_COMMIT=$(git rev-parse HEAD) +/node-version: 18/node-version: 20/ BRANCH_NAME=auto-update-weights-for-dev-${{ github.sha }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ git checkout -b "$BRANCH_NAME" origin/dev +/node-version: 18/node-version: 20/ git cherry-pick "$LAST_COMMIT" +/node-version: 18/node-version: 20/ git push origin "$BRANCH_NAME" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Open PR against dev +/node-version: 18/node-version: 20/ id: open_pr +/node-version: 18/node-version: 20/ uses: rematocorp/open-pull-request-action@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ github-token: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ from-branch: auto-update-weights-for-dev-${{ github.sha }} +/node-version: 18/node-version: 20/ to-branch: dev +/node-version: 18/node-version: 20/ repository-owner: gluwa +/node-version: 18/node-version: 20/ repository: creditcoin +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: PR number against dev +/node-version: 18/node-version: 20/ run: echo ${{ steps.open_pr.outputs.pull_number }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ remove-github-runner: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ - hardware-benchmarks +/node-version: 18/node-version: 20/ if: ${{ always() && needs.deploy-github-runner.result != 'skipped' }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Evaluate env vars +/node-version: 18/node-version: 20/ id: get-env +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: using env.RUNNER_VM_NAME directly in job outputs above +/node-version: 18/node-version: 20/ # doesn't evaluate the $GITHUB_RUN_ID reference +/node-version: 18/node-version: 20/ echo "resource_group=${{ env.RESOURCE_GROUP }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install azure-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt remove azure-cli -y && sudo apt autoremove -y +/node-version: 18/node-version: 20/ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +/node-version: 18/node-version: 20/ az version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Remove VM +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "INFO: RUNNER_VM_NAME=${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ az login --service-principal --username "${{ secrets.AZURE_APP_ID }}" --password "${{ secrets.AZURE_APP_PASSWORD }}" --tenant "${{ secrets.AZURE_TENANT_ID }}" +/node-version: 18/node-version: 20/ az account set --subscription "Playground Subscription" +/node-version: 18/node-version: 20/ az group delete --yes -n "${{ steps.get-env.outputs.resource_group }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: "Azure resources" +/node-version: 18/node-version: 20/ path: azure_resource_list.json diff --git a/.github/workflows/check-runtime-changes.yml b/.github/workflows/check-runtime-changes.yml index 0e9c186fe0..d23b3dda86 100644 --- a/.github/workflows/check-runtime-changes.yml +++ b/.github/workflows/check-runtime-changes.yml @@ -1,31 +1,62 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Check runtime changes +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [dev, testnet, main] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ check-version: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check if version.rs was modified +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-version.sh "remotes/origin/$GITHUB_BASE_REF" "$GITHUB_SHA" +/node-version: 18/node-version: 20/ # dangerous conditions that will brick the blockchain +/node-version: 18/node-version: 20/ danger-will-brick-the-blockchain: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check for changes in Proof-of-Stake EPOCH duration +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-for-changes-in-epoch-duration.sh "remotes/origin/$GITHUB_BASE_REF" "$GITHUB_SHA" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d87210a67..452d29ebef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,817 +1,1634 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: CI +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Controls when the action will run. +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ # Triggers the workflow on push or pull request events but only for the master branch +/node-version: 18/node-version: 20/ push: +/node-version: 18/node-version: 20/ branches: [main, testnet, dev] +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Allows you to run this workflow manually from the Actions tab +/node-version: 18/node-version: 20/ workflow_dispatch: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # A workflow run is made up of one or more jobs that can run sequentially or in parallel +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ docker-build: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build docker image +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker build -t gluwa/creditcoin . +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start a container from image +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # see https://opensource.com/article/18/5/how-find-ip-address-linux +/node-version: 18/node-version: 20/ IP_ADDRESS=$(curl https://ifconfig.me) +/node-version: 18/node-version: 20/ echo "INFO: IP_ADDRESS=$IP_ADDRESS" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ docker run --rm --name creditcoin-validator -d -p 9933:9933 -p 30333:30333 gluwa/creditcoin \ +/node-version: 18/node-version: 20/ --validator --chain mainnet \ +/node-version: 18/node-version: 20/ --name "test-node-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ +/node-version: 18/node-version: 20/ --public-addr "/dns4/$IP_ADDRESS/tcp/30333" \ +/node-version: 18/node-version: 20/ --prometheus-external \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \ +/node-version: 18/node-version: 20/ --bootnodes "/dns4/bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWAEgDL126EUFxFfdQKiUhmx3BJPdszQHu9PsYsLCuavhb" "/dns4/bootnode2.creditcoin.network/tcp/30333/p2p/12D3KooWSQye3uN3bZQRRC4oZbpiAZXkP2o5UZh6S8pqyh24bF3k" "/dns4/bootnode3.creditcoin.network/tcp/30333/p2p/12D3KooWFrsEZ2aSfiigAxs6ir2kU6en4BewotyCXPhrJ7T1AzjN" \ +/node-version: 18/node-version: 20/ --port 30333 --unsafe-rpc-external +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Healtcheck +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sleep 60 +/node-version: 18/node-version: 20/ ./scripts/check-health.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Sanity test creditcoin-cli inside the container +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker exec creditcoin-validator which creditcoin-cli +/node-version: 18/node-version: 20/ docker exec creditcoin-validator creditcoin-cli wizard --help +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill the container +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # this will also kill the parent container +/node-version: 18/node-version: 20/ sudo killall -9 creditcoin-node +/node-version: 18/node-version: 20/ sleep 10 +/node-version: 18/node-version: 20/ docker rm -f creditcoin-validator +/node-version: 18/node-version: 20/ sleep 10 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start docker-compose +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker-compose up -d +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Sanity check for persistently mounted directory +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sleep 60 +/node-version: 18/node-version: 20/ docker exec creditcoin-validator ls -ld /creditcoin-node/data +/node-version: 18/node-version: 20/ docker exec creditcoin-validator ls -la /creditcoin-node/data +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill the container +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # this will also kill the parent container +/node-version: 18/node-version: 20/ sudo killall -9 creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ sanity-tests: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check for parity between extrinsics, benchmarks and weights +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "INFO: active pallets are" +/node-version: 18/node-version: 20/ ./scripts/check-parity-bw-extrinsics-benchmarks-weights.sh --show-pallets +/node-version: 18/node-version: 20/ echo "========================" +/node-version: 18/node-version: 20/ ./scripts/check-parity-bw-extrinsics-benchmarks-weights.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check migrations +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-usage-of-log-warn.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check if Cargo.toml specifies dependencies from forks +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-for-used-forks.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ sanity-test-cli: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install creditcoin-js & creditcoin-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd scripts/cc-cli && yarn upgrade 'creditcoin-js' && yarn build && npm install -g . && popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Execute creditcoin-cli command +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # this makes sure we have a creditcoin-cli entrypoint in the standard PATH +/node-version: 18/node-version: 20/ creditcoin-cli help +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ audit: +/node-version: 18/node-version: 20/ name: cargo audit +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install cargo audit +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ cargo install cargo-audit --features=fix +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run cargo audit +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ cargo audit --ignore RUSTSEC-2020-0071 +/node-version: 18/node-version: 20/ CC_MATCH=$(cargo audit --ignore RUSTSEC-2020-0071 --color never | grep -E "^.── creditcoin" || true) +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # fail for anything which is a 1st level dependency of Creditcoin +/node-version: 18/node-version: 20/ if [ -n "$CC_MATCH" ]; then +/node-version: 18/node-version: 20/ echo "FAIL: Direct dependencies of Creditcoin found in audit report" +/node-version: 18/node-version: 20/ echo "INFO: Inspect the output above for more information" +/node-version: 18/node-version: 20/ exit 1 +/node-version: 18/node-version: 20/ else +/node-version: 18/node-version: 20/ echo "INFO: No direct dependencies of Creditcoin found in audit report" +/node-version: 18/node-version: 20/ exit 0 +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ fmt: +/node-version: 18/node-version: 20/ name: Rustfmt +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ components: rustfmt +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check formatting +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: fmt +/node-version: 18/node-version: 20/ args: -- --check +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ clippy: +/node-version: 18/node-version: 20/ name: Clippy +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ components: clippy +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run Clippy +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: clippy +/node-version: 18/node-version: 20/ args: --all-targets --all-features -- -D warnings -A clippy::too_many_arguments -A clippy::type_complexity +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ check: +/node-version: 18/node-version: 20/ # The type of runner that the job will run on +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Steps represent a sequence of tasks that will be executed as part of the job +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check Build +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ SKIP_WASM_BUILD=1 cargo check --release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check Build for Benchmarking +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ SKIP_WASM_BUILD=1 cargo check --features=runtime-benchmarks --release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ unit-test-creditcoin: +/node-version: 18/node-version: 20/ runs-on: macos-12 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ HOMEBREW_NO_INSTALL_CLEANUP: true +/node-version: 18/node-version: 20/ HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ brew update +/node-version: 18/node-version: 20/ brew install cmake openssl protobuf +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure flags for collecting coverage +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # shellcheck disable=SC2129 +/node-version: 18/node-version: 20/ echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ echo "RUSTFLAGS=-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ echo "RUSTDOCFLAGS=-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run tests +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: test +/node-version: 18/node-version: 20/ args: --features=try-runtime -- --test-threads 1 +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ CARGO_INCREMENTAL: ${{ env.CARGO_INCREMENTAL }} +/node-version: 18/node-version: 20/ RUSTFLAGS: ${{ env.RUSTFLAGS }} +/node-version: 18/node-version: 20/ RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} +/node-version: 18/node-version: 20/ - id: coverage +/node-version: 18/node-version: 20/ uses: actions-rs/grcov@v0.1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ config: .grcov.yml +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - uses: codecov/codecov-action@v3 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ files: ${{ steps.coverage.outputs.report }} +/node-version: 18/node-version: 20/ fail_ci_if_error: false +/node-version: 18/node-version: 20/ verbose: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ unit-test-cli: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Execute tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd scripts/cc-cli +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ yarn test:unit +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - uses: codecov/codecov-action@v3 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ files: scripts/cc-cli/coverage/lcov.info +/node-version: 18/node-version: 20/ fail_ci_if_error: false +/node-version: 18/node-version: 20/ verbose: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-creditcoin-node: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build SUT +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release --features fast-runtime +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload creditcoin-node binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload WASM runtime +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ path: target/release/wbuild/creditcoin-node-runtime/creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ integration-test-cli: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-creditcoin-node +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local Ethereum node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker run --rm -p 8545:8545 -d gluwa/hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node binary +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install creditcoin-js & creditcoin-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd scripts/cc-cli && yarn upgrade 'creditcoin-js' && yarn build && popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start Node 1 +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node \ +/node-version: 18/node-version: 20/ --chain local \ +/node-version: 18/node-version: 20/ --validator --alice --pruning archive \ +/node-version: 18/node-version: 20/ --node-key d182d503b7dd97e7c055f33438c7717145840fd66b2a055284ee8d768241a463 \ +/node-version: 18/node-version: 20/ --base-path ./alice-data & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start Node 2 +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node \ +/node-version: 18/node-version: 20/ --chain local \ +/node-version: 18/node-version: 20/ --validator --bob --pruning archive \ +/node-version: 18/node-version: 20/ --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWKEKymnBDKfa8MkMWiLE6DYbC4aAUciqmYucm7xFKK3Au \ +/node-version: 18/node-version: 20/ --port 30335 --ws-port 9945 --rpc-port 9935 \ +/node-version: 18/node-version: 20/ --base-path ./bob-data & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for nodes to start +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh 'http://127.0.0.1:9933' +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh 'http://127.0.0.1:9935' +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd scripts/cc-cli +/node-version: 18/node-version: 20/ yarn test:integration +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload code coverage +/node-version: 18/node-version: 20/ uses: codecov/codecov-action@v3 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ files: scripts/cc-cli/coverage/lcov.info +/node-version: 18/node-version: 20/ fail_ci_if_error: false +/node-version: 18/node-version: 20/ verbose: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill nodes +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # if all went well kill the node. Otherwise GitHub Actions would exit on the +/node-version: 18/node-version: 20/ # previous step killing everything and we don't have to worry about +/node-version: 18/node-version: 20/ # dangling processes +/node-version: 18/node-version: 20/ killall -9 creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-creditcoin-transaction-producer: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ token: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ repository: gluwa/creditcoin-transaction-producer +/node-version: 18/node-version: 20/ path: creditcoin-transaction-producer +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source creditcoin-transaction-producer/ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build creditcoin-transaction-producer +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-transaction-producer/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ cargo install just +/node-version: 18/node-version: 20/ just install +/node-version: 18/node-version: 20/ just build +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # archive the entire directory, together with binary artifacts and FE artifacts +/node-version: 18/node-version: 20/ tar -czvf creditcoin-transaction-producer.tar.gz creditcoin-transaction-producer/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload creditcoin-transaction-producer archive +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ path: creditcoin-transaction-producer.tar.gz +/node-version: 18/node-version: 20/ name: creditcoin-transaction-producer.tar.gz +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ tools-creditcoin-transaction-producer: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-creditcoin-node +/node-version: 18/node-version: 20/ - build-creditcoin-transaction-producer +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - name: Start local Ethereum node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker run --rm -p 8545:8545 -d gluwa/hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node binary +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start creditcoin-node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --dev --monitor-nonce auto >~/creditcoin-node.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for creditcoin-node to start +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-transaction-producer archive +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-transaction-producer.tar.gz +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start creditcoin-transaction-producer +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ tar -xzvf creditcoin-transaction-producer.tar.gz +/node-version: 18/node-version: 20/ pushd creditcoin-transaction-producer/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Deployer Seed is Private Key for Account #0 in hardhat +/node-version: 18/node-version: 20/ # Funded Account Seed is Alice +/node-version: 18/node-version: 20/ ./target/release/creditcoin-transaction-producer --max-accounts 20 --max-chain-apis 25 \ +/node-version: 18/node-version: 20/ --funded-account-seed '0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a' \ +/node-version: 18/node-version: 20/ --deployer-seed '0xabf82ff96b463e9d82b83cb9bb450fe87e6166d4db6d7021d0c71d7e960d5abe' \ +/node-version: 18/node-version: 20/ --setup --frontend ./dist >~/creditcoin-transaction-producer.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Sanity check that creditcoin-transaction-producer started +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sleep 20 +/node-version: 18/node-version: 20/ ./scripts/check-transaction-producer.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: transaction-producer-logs +/node-version: 18/node-version: 20/ path: ~/creditcoin-*.log +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill SUT +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -9 creditcoin-node +/node-version: 18/node-version: 20/ killall -9 creditcoin-transaction-producer +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ integration-test-loan-cycle: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-creditcoin-node +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ # checkov:skip=CKV2_GHA_1:We need this for creditcoin-js typedefs auto-commit +/node-version: 18/node-version: 20/ permissions: write-all +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 10 +/node-version: 18/node-version: 20/ repository: ${{ github.event.pull_request.head.repo.full_name }} +/node-version: 18/node-version: 20/ ref: ${{ github.event.pull_request.head.ref }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node binary +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start SUT +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --dev --monitor-nonce auto >~/creditcoin-node.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local Ethereum node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker run --rm -p 8545:8545 -d gluwa/hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Prepare for integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd integration-tests/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # wait for creditcoin-node to initialize +/node-version: 18/node-version: 20/ ./yarn-install-and-wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ git checkout yarn.lock +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Auto-update typedefs +/node-version: 18/node-version: 20/ id: update_typedefs +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./get-metadata.sh +/node-version: 18/node-version: 20/ yarn build:types +/node-version: 18/node-version: 20/ yarn format +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ echo "========== DEBUG DEBUG DEBUG ==========" +/node-version: 18/node-version: 20/ git status --short +/node-version: 18/node-version: 20/ git diff +/node-version: 18/node-version: 20/ echo "=======================================" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ if [ -n "$(git status --short)" ]; then +/node-version: 18/node-version: 20/ git diff +/node-version: 18/node-version: 20/ echo "git_diff=true" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Execute integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd integration-tests/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn test +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Git diff in case of failure +/node-version: 18/node-version: 20/ if: failure() +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ git diff +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Commit changes for typedefs +/node-version: 18/node-version: 20/ if: ${{ success() && steps.update_typedefs.outputs.git_diff == 'true' }} +/node-version: 18/node-version: 20/ uses: EndBug/add-and-commit@v9 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ author_name: gluwa-bot +/node-version: 18/node-version: 20/ author_email: creditcoin@gluwa.com +/node-version: 18/node-version: 20/ message: "Auto-update creditcoin-js type definitions" +/node-version: 18/node-version: 20/ github_token: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: ~/creditcoin-node.log +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill SUT +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # if all went well kill the node. Otherwise GitHub Actions would exit on the +/node-version: 18/node-version: 20/ # previous step killing everything and we don't have to worry about +/node-version: 18/node-version: 20/ # dangling processes +/node-version: 18/node-version: 20/ killall -9 creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ javascript-lint: +/node-version: 18/node-version: 20/ name: javascript-lint / ${{ matrix.directory }} +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ strategy: +/node-version: 18/node-version: 20/ matrix: +/node-version: 18/node-version: 20/ directory: +/node-version: 18/node-version: 20/ [creditcoin-js, integration-tests, scripts/js, scripts/cc-cli] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run tools +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd ${{ matrix.directory }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ yarn lint +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ javascript-typecheck: +/node-version: 18/node-version: 20/ name: javascript-typecheck / ${{ matrix.directory }} +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ strategy: +/node-version: 18/node-version: 20/ matrix: +/node-version: 18/node-version: 20/ directory: +/node-version: 18/node-version: 20/ [creditcoin-js, integration-tests, scripts/js, scripts/cc-cli] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run tools +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd ${{ matrix.directory }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ yarn typecheck +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ javascript-format: +/node-version: 18/node-version: 20/ name: javascript-format / ${{ matrix.directory }} +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ strategy: +/node-version: 18/node-version: 20/ matrix: +/node-version: 18/node-version: 20/ directory: +/node-version: 18/node-version: 20/ [creditcoin-js, integration-tests, scripts/js, scripts/cc-cli] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run tools +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ pushd ${{ matrix.directory }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ if ! yarn check-format; then +/node-version: 18/node-version: 20/ echo "FAIL: JavaScript is not formatted properly!" +/node-version: 18/node-version: 20/ echo "HELP: Execute 'yarn format' and commit the changes to fix this" +/node-version: 18/node-version: 20/ exit 1 +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ benchmark: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Inspect benchmark CI config +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: Command below may differ depending on which workflow config file +/node-version: 18/node-version: 20/ # your job is defined in !!! Don't copy&paste it blindly !!! +/node-version: 18/node-version: 20/ PALLETS_IN_CI_CONFIG=$(grep "./scripts/bench.sh -p" .github/workflows/ci.yml | grep -v PALLETS_IN_CI_CONFIG | tr -s ' ' | cut -d' ' -f4 | sort | xargs) +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ PALLETS_IN_SOURCE=$(./scripts/check-parity-bw-extrinsics-benchmarks-weights.sh --show-pallets) +/node-version: 18/node-version: 20/ if [ "$PALLETS_IN_CI_CONFIG" != "$PALLETS_IN_SOURCE" ]; then +/node-version: 18/node-version: 20/ echo "FAIL: Pallet mismatch between source code and benchmark CI config" +/node-version: 18/node-version: 20/ echo "INFO: in source: '$PALLETS_IN_SOURCE'" +/node-version: 18/node-version: 20/ echo "INFO: CI config: '$PALLETS_IN_CI_CONFIG'" +/node-version: 18/node-version: 20/ exit 1 +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build benchmarks +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release --features runtime-benchmarks +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check if runner machine meets chain's requirements +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-hardware.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run benchmarks to generate dummy weights +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p creditcoin -b -r 1 -s 2 +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p offchain_task_scheduler -b -r 1 -s 2 +/node-version: 18/node-version: 20/ ./scripts/bench.sh -p rewards -b -r 1 -s 2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # check if automatically generated weights compile +/node-version: 18/node-version: 20/ - name: Rebuild SUT with newly generated weights +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ shellcheck: +/node-version: 18/node-version: 20/ name: "🐚 Shellcheck" +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ - name: Run ShellCheck +/node-version: 18/node-version: 20/ uses: ludeeus/action-shellcheck@2.0.0 +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ SHELLCHECK_OPTS: -e SC2002 # allow useless cat commands diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d14e7414c3..f9f6a74b0e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,73 +1,146 @@ +/node-version: 18/node-version: 20/ # For most projects, this workflow file will not need changing; you simply need +/node-version: 18/node-version: 20/ # to commit it to your repository. +/node-version: 18/node-version: 20/ # +/node-version: 18/node-version: 20/ # You may wish to alter this file to override the set of languages analyzed, +/node-version: 18/node-version: 20/ # or to provide custom queries or build logic. +/node-version: 18/node-version: 20/ # +/node-version: 18/node-version: 20/ # ******** NOTE ******** +/node-version: 18/node-version: 20/ # We have attempted to detect the languages in your repository. Please check +/node-version: 18/node-version: 20/ # the `language` matrix defined below to confirm you have the correct set of +/node-version: 18/node-version: 20/ # supported CodeQL languages. +/node-version: 18/node-version: 20/ # +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: "CodeQL" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: ["dev"] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ analyze: +/node-version: 18/node-version: 20/ name: Analyze +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ permissions: +/node-version: 18/node-version: 20/ actions: read +/node-version: 18/node-version: 20/ contents: read +/node-version: 18/node-version: 20/ security-events: write +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ strategy: +/node-version: 18/node-version: 20/ fail-fast: false +/node-version: 18/node-version: 20/ matrix: +/node-version: 18/node-version: 20/ language: ["javascript"] +/node-version: 18/node-version: 20/ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] +/node-version: 18/node-version: 20/ # Use only 'java' to analyze code written in Java, Kotlin or both +/node-version: 18/node-version: 20/ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both +/node-version: 18/node-version: 20/ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - name: Checkout repository +/node-version: 18/node-version: 20/ uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Initializes the CodeQL tools for scanning. +/node-version: 18/node-version: 20/ - name: Initialize CodeQL +/node-version: 18/node-version: 20/ uses: github/codeql-action/init@v3 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ languages: ${{ matrix.language }} +/node-version: 18/node-version: 20/ # If you wish to specify custom queries, you can do so here or in a config file. +/node-version: 18/node-version: 20/ # By default, queries listed here will override any specified in a config file. +/node-version: 18/node-version: 20/ # Prefix the list here with "+" to use these queries and those in the config file. +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs +/node-version: 18/node-version: 20/ # queries: security-extended,security-and-quality +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). +/node-version: 18/node-version: 20/ # If this step fails, then you should remove it and run the build manually (see below) +/node-version: 18/node-version: 20/ - name: Autobuild +/node-version: 18/node-version: 20/ uses: github/codeql-action/autobuild@v3 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # ℹ️ Command-line programs to run using the OS shell. +/node-version: 18/node-version: 20/ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # If the Autobuild fails above, remove it and uncomment the following three lines. +/node-version: 18/node-version: 20/ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # - run: | +/node-version: 18/node-version: 20/ # echo "Run, Build Application using script" +/node-version: 18/node-version: 20/ # ./location_of_script_within_repo/buildscript.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Perform CodeQL Analysis +/node-version: 18/node-version: 20/ uses: github/codeql-action/analyze@v3 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ category: "/language:${{matrix.language}}" diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 09f451440b..816a44ac65 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,40 +1,80 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Deploy docs +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ push: +/node-version: 18/node-version: 20/ branches: +/node-version: 18/node-version: 20/ - dev +/node-version: 18/node-version: 20/ workflow_dispatch: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ deploy: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ # checkov:skip=CKV2_GHA_1:We need this for the git push command below +/node-version: 18/node-version: 20/ permissions: write-all +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ - name: Install mdbook +/node-version: 18/node-version: 20/ uses: taiki-e/install-action@v2.23.7 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ tool: mdbook,mdbook-mermaid +/node-version: 18/node-version: 20/ - name: Deploy GitHub Pages +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # This assumes your book is in the root of your repository. +/node-version: 18/node-version: 20/ # Just add a `cd` here if you need to change to another directory. +/node-version: 18/node-version: 20/ cd docs/dev-guide +/node-version: 18/node-version: 20/ mdbook build +/node-version: 18/node-version: 20/ git worktree add gh-pages +/node-version: 18/node-version: 20/ git config user.name "Deploy from CI" +/node-version: 18/node-version: 20/ git config user.email "" +/node-version: 18/node-version: 20/ cd gh-pages +/node-version: 18/node-version: 20/ # Delete the ref to avoid keeping history. +/node-version: 18/node-version: 20/ git update-ref -d refs/heads/gh-pages +/node-version: 18/node-version: 20/ rm -rf ./* +/node-version: 18/node-version: 20/ mv ../book/* . +/node-version: 18/node-version: 20/ git add . +/node-version: 18/node-version: 20/ git commit -m "Deploy $GITHUB_SHA to gh-pages" +/node-version: 18/node-version: 20/ git push --force --set-upstream origin gh-pages diff --git a/.github/workflows/extrinsics.yml b/.github/workflows/extrinsics.yml index b953341107..eaceccf0c6 100644 --- a/.github/workflows/extrinsics.yml +++ b/.github/workflows/extrinsics.yml @@ -1,70 +1,140 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Check Runtime and Extrinsics +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # This CI checks for changes in Creditcoin runtime and extrinsic ordering +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Controls when the action will run. +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [dev] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Allows you to run this workflow manually from the Actions tab +/node-version: 18/node-version: 20/ workflow_dispatch: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ run_extrinsics: +/node-version: 18/node-version: 20/ name: Extrinsics +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ - name: Install Node Dependencies +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: - node-version: 18 +/node-version: 18/node-version: 20/ + node-version: 20 +/node-version: 18/node-version: 20/ - run: npm install --ignore-scripts -g @polkadot/metadata-cmp +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build Release +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run Extrinsics Ordering +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-extrinsics.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ #Upload logs if nodes are not connecting. +/node-version: 18/node-version: 20/ #head-node.log and release-node.log are created in ./scripts/check-extrinsics.sh +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ if-no-files-found: warn +/node-version: 18/node-version: 20/ name: "extrinsic-logs" +/node-version: 18/node-version: 20/ path: | +/node-version: 18/node-version: 20/ head-node.log +/node-version: 18/node-version: 20/ release-node.log +/node-version: 18/node-version: 20/ metadata-cmp-with-mainnet.txt +/node-version: 18/node-version: 20/ metadata-cmp-with-testnet.txt diff --git a/.github/workflows/llvm-cov.yml b/.github/workflows/llvm-cov.yml index 2b06824e05..11a4ae7262 100644 --- a/.github/workflows/llvm-cov.yml +++ b/.github/workflows/llvm-cov.yml @@ -1,102 +1,204 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: llvm-cov +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Controls when the action will run. +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ upload-coverage-info: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ permissions: +/node-version: 18/node-version: 20/ pull-requests: write +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-1-install-with-one-command +/node-version: 18/node-version: 20/ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ components: llvm-tools-preview +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install cargo-llvm-cov +/node-version: 18/node-version: 20/ uses: taiki-e/install-action@v2.23.7 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ tool: cargo-llvm-cov +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Run tests +/node-version: 18/node-version: 20/ if: env.GITHUB_TOKEN +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ id: coverage +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ PR_NUMBER=$(echo "$GITHUB_REF" | sed "s|refs/pull/||" | sed "s|/merge||") +/node-version: 18/node-version: 20/ export PR_NUMBER +/node-version: 18/node-version: 20/ echo "**For full LLVM coverage report [click here](https://staticsitellvmhtml.z13.web.core.windows.net/$PR_NUMBER/html/)!**" > uncovered-lines.log +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ cargo llvm-cov --features=try-runtime \ +/node-version: 18/node-version: 20/ --workspace --html --show-missing-lines --hide-instantiations \ +/node-version: 18/node-version: 20/ --ignore-filename-regex "(tests.rs|mock.rs)" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ UNCOVERED_LINES=$(sed "s|$(pwd)|.|" uncovered-lines.log) +/node-version: 18/node-version: 20/ # workaround the fact that GitHub Actions doesn't support multi-line output +/node-version: 18/node-version: 20/ # https://trstringer.com/github-actions-multiline-strings/ +/node-version: 18/node-version: 20/ UNCOVERED_LINES="${UNCOVERED_LINES//'%'/'%25'}" +/node-version: 18/node-version: 20/ UNCOVERED_LINES="${UNCOVERED_LINES//$'\n'/'%0A'}" +/node-version: 18/node-version: 20/ UNCOVERED_LINES="${UNCOVERED_LINES//$'\r'/'%0D'}" +/node-version: 18/node-version: 20/ echo "uncovered_lines=$UNCOVERED_LINES" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Azure login +/node-version: 18/node-version: 20/ if: env.GITHUB_TOKEN +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ uses: azure/login@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ creds: ${{ secrets.AZURE_CREDENTIALS }} +/node-version: 18/node-version: 20/ allow-no-subscriptions: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload coverage report to Azure Storage +/node-version: 18/node-version: 20/ if: env.GITHUB_TOKEN +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ AZURE_STORAGE_KEY=${{ secrets.LLVM_AZURE_STORAGE_KEY }} +/node-version: 18/node-version: 20/ export AZURE_STORAGE_KEY +/node-version: 18/node-version: 20/ PR_NUMBER=$(echo "$GITHUB_REF" | sed "s|refs/pull/||" | sed "s|/merge||") +/node-version: 18/node-version: 20/ export PR_NUMBER +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ az storage blob upload-batch --account-name staticsitellvmhtml --auth-mode key -d "\$web" --destination-path "$PR_NUMBER" --overwrite -s ./target/llvm-cov +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Post comment to PR +/node-version: 18/node-version: 20/ if: env.GITHUB_TOKEN +/node-version: 18/node-version: 20/ uses: mshick/add-pr-comment@v2 +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ GITHUB_TOKEN: ${{ secrets.CREDITCOIN_GITHUB_API_TOKEN }} +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ message: ${{ steps.coverage.outputs.uncovered_lines }} +/node-version: 18/node-version: 20/ allow-repeats: false +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload coverage report as artifact +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: coverage-report +/node-version: 18/node-version: 20/ path: target/llvm-cov/html/ diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 5274d796ad..c473d9267c 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -1,81 +1,162 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ # MegaLinter GitHub Action configuration file +/node-version: 18/node-version: 20/ # More info at https://megalinter.io +/node-version: 18/node-version: 20/ name: MegaLinter +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [dev] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ env: # Comment env block if you do not want to apply fixes +/node-version: 18/node-version: 20/ # Apply linter fixes configuration +/node-version: 18/node-version: 20/ APPLY_FIXES: none # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) +/node-version: 18/node-version: 20/ APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) +/node-version: 18/node-version: 20/ APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ concurrency: +/node-version: 18/node-version: 20/ group: ${{ github.ref }}-${{ github.workflow }} +/node-version: 18/node-version: 20/ cancel-in-progress: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ build: +/node-version: 18/node-version: 20/ name: MegaLinter +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ # Git Checkout +/node-version: 18/node-version: 20/ - name: Checkout Code +/node-version: 18/node-version: 20/ uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} +/node-version: 18/node-version: 20/ fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # MegaLinter +/node-version: 18/node-version: 20/ - name: MegaLinter +/node-version: 18/node-version: 20/ id: ml +/node-version: 18/node-version: 20/ # You can override MegaLinter flavor used to have faster performances +/node-version: 18/node-version: 20/ # More info at https://megalinter.io/latest/flavors/ +/node-version: 18/node-version: 20/ uses: oxsecurity/megalinter/flavors/rust@v7 +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ # All available variables are described at https://megalinter.io/latest/configuration/ +/node-version: 18/node-version: 20/ # and configured in .mega-linter.yml +/node-version: 18/node-version: 20/ VALIDATE_ALL_CODEBASE: true +/node-version: 18/node-version: 20/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Upload MegaLinter artifacts +/node-version: 18/node-version: 20/ - name: Archive production artifacts +/node-version: 18/node-version: 20/ if: success() || failure() +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: MegaLinter reports +/node-version: 18/node-version: 20/ path: | +/node-version: 18/node-version: 20/ megalinter-reports +/node-version: 18/node-version: 20/ mega-linter.log +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Create pull request if applicable (for now works only on PR from same repository, not from forks) +/node-version: 18/node-version: 20/ - name: Create Pull Request with applied fixes +/node-version: 18/node-version: 20/ id: cpr +/node-version: 18/node-version: 20/ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) +/node-version: 18/node-version: 20/ uses: peter-evans/create-pull-request@v5 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} +/node-version: 18/node-version: 20/ commit-message: "[MegaLinter] Apply linters automatic fixes" +/node-version: 18/node-version: 20/ title: "[MegaLinter] Apply linters automatic fixes" +/node-version: 18/node-version: 20/ labels: bot +/node-version: 18/node-version: 20/ - name: Create PR output +/node-version: 18/node-version: 20/ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" +/node-version: 18/node-version: 20/ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # Push new commit if applicable (for now works only on PR from same repository, not from forks) +/node-version: 18/node-version: 20/ - name: Prepare commit +/node-version: 18/node-version: 20/ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/dev' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) +/node-version: 18/node-version: 20/ run: sudo chown -Rc $UID .git/ +/node-version: 18/node-version: 20/ - name: Commit and push applied linter fixes +/node-version: 18/node-version: 20/ if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/dev' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) +/node-version: 18/node-version: 20/ uses: stefanzweifel/git-auto-commit-action@v5 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} +/node-version: 18/node-version: 20/ commit_message: "[MegaLinter] Apply linters fixes" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe7647eae0..2ed45457c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,267 +1,534 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Build Release Artifacts +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ push: +/node-version: 18/node-version: 20/ tags: +/node-version: 18/node-version: 20/ - "*" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ sanity-check: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Sanity check tag name +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ git describe --tag | grep -E "mainnet|testnet" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-native-runtime: +/node-version: 18/node-version: 20/ needs: sanity-check +/node-version: 18/node-version: 20/ strategy: +/node-version: 18/node-version: 20/ fail-fast: false +/node-version: 18/node-version: 20/ matrix: +/node-version: 18/node-version: 20/ operating-system: [ubuntu-22.04, windows-2022, macos-11] +/node-version: 18/node-version: 20/ runs-on: ${{ matrix.operating-system }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-up Linux +/node-version: 18/node-version: 20/ if: matrix.operating-system == 'ubuntu-22.04' +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install protobuf +/node-version: 18/node-version: 20/ uses: arduino/setup-protoc@v2 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ repo-token: ${{ secrets.GITHUB_TOKEN }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install MacOS aarch64 target +/node-version: 18/node-version: 20/ if: matrix.operating-system == 'macos-11' +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: aarch64-apple-darwin +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out platform +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ PLATFORM=$(rustup target list --installed | grep "$(uname -m)") +/node-version: 18/node-version: 20/ echo "PLATFORM=$PLATFORM" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out tag name +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ TAG_NAME=$(git describe --tag) +/node-version: 18/node-version: 20/ echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: DEBUG +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "Tag & Platform is '${{ env.TAG_NAME }}-${{ env.PLATFORM }}'" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build MacOS aarch64 target +/node-version: 18/node-version: 20/ if: matrix.operating-system == 'macos-11' +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release --target aarch64-apple-darwin +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Compress +/node-version: 18/node-version: 20/ uses: thedoctor0/zip-release@0.7.6 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ type: "zip" +/node-version: 18/node-version: 20/ directory: "target/release/" +/node-version: 18/node-version: 20/ path: "creditcoin-node*" +/node-version: 18/node-version: 20/ filename: "../../creditcoin-${{ env.TAG_NAME }}-${{ env.PLATFORM }}.zip" +/node-version: 18/node-version: 20/ exclusions: "creditcoin-node.d" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Compress MacOS aarch64 target +/node-version: 18/node-version: 20/ if: matrix.operating-system == 'macos-11' +/node-version: 18/node-version: 20/ uses: thedoctor0/zip-release@0.7.6 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ type: "zip" +/node-version: 18/node-version: 20/ directory: "target/aarch64-apple-darwin/release/" +/node-version: 18/node-version: 20/ path: "creditcoin-node*" +/node-version: 18/node-version: 20/ filename: "../../../creditcoin-${{ env.TAG_NAME }}-aarch64-apple-darwin.zip" +/node-version: 18/node-version: 20/ exclusions: "creditcoin-node.d" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ path: "creditcoin-${{ env.TAG_NAME }}-*.zip" +/node-version: 18/node-version: 20/ if-no-files-found: error +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-wasm-runtime: +/node-version: 18/node-version: 20/ needs: sanity-check +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out tag name +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ TAG_NAME=$(git describe --tag) +/node-version: 18/node-version: 20/ echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build WASM runtime +/node-version: 18/node-version: 20/ id: srtool_build +/node-version: 18/node-version: 20/ uses: chevdor/srtool-actions@v0.8.0 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ chain: "creditcoin" +/node-version: 18/node-version: 20/ runtime_dir: runtime +/node-version: 18/node-version: 20/ package: creditcoin-node-runtime +/node-version: 18/node-version: 20/ tag: "1.66.1" # FIXME: remove this option (use the latest) once we're building w/ stable rust +/node-version: 18/node-version: 20/ workdir: ${{ github.workspace }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: DEBUG +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo '${{ steps.srtool_build.outputs.json }}' | jq . > creditcoin-srtool-digest.json +/node-version: 18/node-version: 20/ cat creditcoin-srtool-digest.json +/node-version: 18/node-version: 20/ echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Rename file +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ mv ${{ steps.srtool_build.outputs.wasm }} creditcoin-${{ env.TAG_NAME }}-runtime.wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ path: "*.wasm" +/node-version: 18/node-version: 20/ if-no-files-found: error +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ docker-build: +/node-version: 18/node-version: 20/ needs: sanity-check +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out tag name +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ TAG_NAME=$(git describe --tag) +/node-version: 18/node-version: 20/ echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build docker image +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ docker build -t gluwa/creditcoin:${{ env.TAG_NAME }} . +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ echo "${{ secrets.DOCKER_PUSH_PASSWORD }}" | docker login -u="${{ secrets.DOCKER_PUSH_USERNAME }}" --password-stdin +/node-version: 18/node-version: 20/ docker push gluwa/creditcoin:${{ env.TAG_NAME }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # only -mainnet images are tagged as :latest +/node-version: 18/node-version: 20/ # shellcheck disable=SC2046,SC2143 +/node-version: 18/node-version: 20/ if [ $(echo "${{ env.TAG_NAME}}" | grep "mainnet") ]; then +/node-version: 18/node-version: 20/ docker tag gluwa/creditcoin:${{ env.TAG_NAME }} gluwa/creditcoin:latest +/node-version: 18/node-version: 20/ docker push gluwa/creditcoin:latest +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ docker logout +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-creditcoin-js: +/node-version: 18/node-version: 20/ needs: sanity-check +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out tag name +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ TAG_NAME=$(git describe --tag) +/node-version: 18/node-version: 20/ echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build creditcoin-js package +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd creditcoin-js/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # version will match the git tag +/node-version: 18/node-version: 20/ echo "DEBUG: Tag is '${{ env.TAG_NAME }}" +/node-version: 18/node-version: 20/ sed -i 's/"version": ".*",/"version": "${{ env.TAG_NAME }}",/' package.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ yarn install && yarn pack +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ path: "creditcoin-js/creditcoin-js-v${{ env.TAG_NAME }}.tgz" +/node-version: 18/node-version: 20/ if-no-files-found: error +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ create-release: +/node-version: 18/node-version: 20/ permissions: +/node-version: 18/node-version: 20/ contents: write +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-native-runtime +/node-version: 18/node-version: 20/ - build-wasm-runtime +/node-version: 18/node-version: 20/ - build-creditcoin-js +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ fetch-depth: 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Figure out tag name +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ TAG_NAME=$(git describe --tag) +/node-version: 18/node-version: 20/ echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download binaries +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: DEBUG +/node-version: 18/node-version: 20/ shell: bash +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ls -lR +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Make the release +/node-version: 18/node-version: 20/ uses: softprops/action-gh-release@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ files: "artifact/creditcoin-*${{ env.TAG_NAME }}*" +/node-version: 18/node-version: 20/ fail_on_unmatched_files: true +/node-version: 18/node-version: 20/ name: ${{ env.TAG_NAME }} diff --git a/.github/workflows/runtime-upgrade.yml b/.github/workflows/runtime-upgrade.yml index ab42a4653b..0056c211dd 100644 --- a/.github/workflows/runtime-upgrade.yml +++ b/.github/workflows/runtime-upgrade.yml @@ -1,752 +1,1504 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Runtime Upgrade +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [main, testnet] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ RUNNER_VM_NAME: "github-runner-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" +/node-version: 18/node-version: 20/ RESOURCE_GROUP: "github-runner-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" +/node-version: 18/node-version: 20/ AZ_LOCATION: "westus3" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ setup: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ outputs: +/node-version: 18/node-version: 20/ test_config: ${{ steps.testnet-env.outputs.test_config || steps.mainnet-env.outputs.test_config }} +/node-version: 18/node-version: 20/ target_chain: ${{ steps.testnet-env.outputs.target_chain || steps.mainnet-env.outputs.target_chain }} +/node-version: 18/node-version: 20/ boot_node: ${{ steps.testnet-env.outputs.boot_node || steps.mainnet-env.outputs.boot_node }} +/node-version: 18/node-version: 20/ rpc_url: ${{ steps.testnet-env.outputs.rpc_url || steps.mainnet-env.outputs.rpc_url }} +/node-version: 18/node-version: 20/ https_rpc_url: ${{ steps.testnet-env.https_rpc_url || steps.mainnet-env.outputs.https_rpc_url }} +/node-version: 18/node-version: 20/ release_tag: ${{ steps.testnet-env.outputs.release_tag || steps.mainnet-env.outputs.release_tag }} +/node-version: 18/node-version: 20/ artifact_name: ${{ steps.testnet-env.outputs.artifact_name || steps.mainnet-env.outputs.artifact_name }} +/node-version: 18/node-version: 20/ last_block_hash: ${{ steps.last-block-info.outputs.last_block_hash }} +/node-version: 18/node-version: 20/ last_block_number: ${{ steps.last-block-info.outputs.last_block_number }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y jq +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Testnet ENV +/node-version: 18/node-version: 20/ id: testnet-env +/node-version: 18/node-version: 20/ if: github.base_ref == 'testnet' +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # shellcheck disable=SC2129 +/node-version: 18/node-version: 20/ echo "target_chain=test" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "test_config=testnet.config.ts" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "boot_node=/dns4/testnet-bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWG3eEuYxo37LvU1g6SSESu4i9TQ8FrZmJcjvdys7eA3cH" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "rpc_url=wss://rpc.testnet.creditcoin.network:443/ws" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "https_rpc_url=https://rpc.testnet.creditcoin.network/rpc" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ RELEASE_TAG=$(./scripts/extract-release-tag.sh "testnet") +/node-version: 18/node-version: 20/ echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "artifact_name=creditcoin-$RELEASE_TAG-$(uname -m)-unknown-linux-gnu.zip" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Mainnet ENV +/node-version: 18/node-version: 20/ id: mainnet-env +/node-version: 18/node-version: 20/ if: github.base_ref == 'main' +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # shellcheck disable=SC2129 +/node-version: 18/node-version: 20/ echo "target_chain=main" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "test_config=mainnet.config.ts" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "boot_node=/dns4/bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWAEgDL126EUFxFfdQKiUhmx3BJPdszQHu9PsYsLCuavhb" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "rpc_url=wss://rpc.mainnet.creditcoin.network:443/ws" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "https_rpc_url=https://rpc.mainnet.creditcoin.network/rpc" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ RELEASE_TAG=$(./scripts/extract-release-tag.sh "mainnet") +/node-version: 18/node-version: 20/ echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "artifact_name=creditcoin-$RELEASE_TAG-$(uname -m)-unknown-linux-gnu.zip" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Store last block info +/node-version: 18/node-version: 20/ id: last-block-info +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # store info about the last finalized block before the fork +/node-version: 18/node-version: 20/ # WARNING: using getBlockHash() instead of getFinalizedHead() b/c PoW doesn't have finalization +/node-version: 18/node-version: 20/ LAST_BLOCK=$(curl --silent -H "Content-Type: application/json" \ +/node-version: 18/node-version: 20/ -d '{"id": 1, "jsonrpc": "2.0", "method": "chain_getBlockHash", "params": [] }' \ +/node-version: 18/node-version: 20/ ${{ env.HTTPS_RPC_URL }} | jq -r .result) +/node-version: 18/node-version: 20/ echo "$LAST_BLOCK" > last-block.hash +/node-version: 18/node-version: 20/ echo "last_block_hash=$LAST_BLOCK" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ while true; do +/node-version: 18/node-version: 20/ curl --silent -H "Content-Type: application/json" \ +/node-version: 18/node-version: 20/ -d "{\"id\": 1, \"jsonrpc\": \"2.0\", \"method\": \"chain_getBlock\", \"params\": [\"$LAST_BLOCK\"] }" \ +/node-version: 18/node-version: 20/ ${{ env.HTTPS_RPC_URL }} | jq -r .result > last-block.json +/node-version: 18/node-version: 20/ LAST_BLOCK_NUMBER=$(jq -r .block.header.number last-block.json) +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ if [ "$LAST_BLOCK_NUMBER" != "null" ]; then +/node-version: 18/node-version: 20/ break +/node-version: 18/node-version: 20/ else +/node-version: 18/node-version: 20/ echo "INFO: retry fetching block infor for $LAST_BLOCK" +/node-version: 18/node-version: 20/ sleep 60 +/node-version: 18/node-version: 20/ fi +/node-version: 18/node-version: 20/ done +/node-version: 18/node-version: 20/ echo "last_block_number=$LAST_BLOCK_NUMBER" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ HTTPS_RPC_URL: ${{ steps.testnet-env.outputs.https_rpc_url || steps.mainnet-env.outputs.https_rpc_url }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload last block info +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: last-block-info +/node-version: 18/node-version: 20/ path: "last-block*" +/node-version: 18/node-version: 20/ if-no-files-found: error +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ build-sut: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Set-Up +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler +/node-version: 18/node-version: 20/ sudo apt install -y unzip jq +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ target: wasm32-unknown-unknown +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ - uses: Swatinem/rust-cache@v2 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Build SUT +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: build +/node-version: 18/node-version: 20/ args: --release --features "try-runtime" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload creditcoin-node binary +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload WASM runtime +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ path: target/release/wbuild/creditcoin-node-runtime/creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ setup-self-hosted: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - name: Grant everyone permissions on /mnt +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo chmod a+rwx /mnt +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ fork-creditcoin: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - setup-self-hosted +/node-version: 18/node-version: 20/ - live-sync-creditcoin +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node for release ${{ needs.setup.outputs.release_tag }} +/node-version: 18/node-version: 20/ uses: i3h/download-release-asset@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ owner: gluwa +/node-version: 18/node-version: 20/ repo: creditcoin +/node-version: 18/node-version: 20/ tag: ${{ needs.setup.outputs.release_tag }} +/node-version: 18/node-version: 20/ file: ${{ needs.setup.outputs.artifact_name }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-fork +/node-version: 18/node-version: 20/ uses: i3h/download-release-asset@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ owner: gluwa +/node-version: 18/node-version: 20/ repo: creditcoin-fork +/node-version: 18/node-version: 20/ tag: latest +/node-version: 18/node-version: 20/ file: creditcoin-fork +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local creditcoin-node for ${{ needs.setup.outputs.target_chain }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # see https://opensource.com/article/18/5/how-find-ip-address-linux +/node-version: 18/node-version: 20/ IP_ADDRESS=$(curl https://ifconfig.me) +/node-version: 18/node-version: 20/ echo "INFO: IP_ADDRESS=$IP_ADDRESS" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y unzip +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ unzip creditcoin-*-unknown-linux-gnu.zip +/node-version: 18/node-version: 20/ chmod a+x ./creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./creditcoin-node --version +/node-version: 18/node-version: 20/ ./creditcoin-node \ +/node-version: 18/node-version: 20/ --name "test-node-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ +/node-version: 18/node-version: 20/ --chain ${{ needs.setup.outputs.target_chain }} \ +/node-version: 18/node-version: 20/ --bootnodes "${{ needs.setup.outputs.boot_node }}" \ +/node-version: 18/node-version: 20/ --prometheus-external \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \ +/node-version: 18/node-version: 20/ --base-path /mnt \ +/node-version: 18/node-version: 20/ --public-addr "/dns4/$IP_ADDRESS/tcp/50555" \ +/node-version: 18/node-version: 20/ --port 50555 >creditcoin-node-used-for-fork.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for creditcoin-node to initialize +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Create fork +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./creditcoin-fork +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./creditcoin-fork --bin ./creditcoin-node --orig ${{ needs.setup.outputs.target_chain }} \ +/node-version: 18/node-version: 20/ --base dev --name Development \ +/node-version: 18/node-version: 20/ -o creditcoin-fork.json --rpc ws://127.0.0.1:9944 --exclude-pallets PosSwitch +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: TERM creditcoin-node +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -TERM creditcoin-node +/node-version: 18/node-version: 20/ sleep 120 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: KILL creditcoin-node +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -KILL creditcoin-node +/node-version: 18/node-version: 20/ sleep 120 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: "*.log" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload creditcoin-fork.json +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-fork.json +/node-version: 18/node-version: 20/ path: creditcoin-fork.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ live-sync-creditcoin: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - setup-self-hosted +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node for release ${{ needs.setup.outputs.release_tag }} +/node-version: 18/node-version: 20/ uses: i3h/download-release-asset@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ owner: gluwa +/node-version: 18/node-version: 20/ repo: creditcoin +/node-version: 18/node-version: 20/ tag: ${{ needs.setup.outputs.release_tag }} +/node-version: 18/node-version: 20/ file: ${{ needs.setup.outputs.artifact_name }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Sync with ${{ needs.setup.outputs.target_chain }} past block number ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # see https://opensource.com/article/18/5/how-find-ip-address-linux +/node-version: 18/node-version: 20/ IP_ADDRESS=$(curl https://ifconfig.me) +/node-version: 18/node-version: 20/ echo "INFO: IP_ADDRESS=$IP_ADDRESS" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ sudo apt-get update +/node-version: 18/node-version: 20/ sudo apt install -y unzip +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ unzip creditcoin-*-unknown-linux-gnu.zip +/node-version: 18/node-version: 20/ chmod a+x ./creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./creditcoin-node --version +/node-version: 18/node-version: 20/ ./creditcoin-node \ +/node-version: 18/node-version: 20/ --name "test-node-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ +/node-version: 18/node-version: 20/ --chain ${{ needs.setup.outputs.target_chain }} \ +/node-version: 18/node-version: 20/ --bootnodes "${{ needs.setup.outputs.boot_node }}" \ +/node-version: 18/node-version: 20/ --prometheus-external --pruning archive \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \ +/node-version: 18/node-version: 20/ --public-addr "/dns4/$IP_ADDRESS/tcp/50555" \ +/node-version: 18/node-version: 20/ --base-path /mnt \ +/node-version: 18/node-version: 20/ --port 50555 >creditcoin-node-initial-live-sync.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for creditcoin-node to sync past block number ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/wait-for-sync.sh ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: TERM creditcoin-node +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -TERM creditcoin-node +/node-version: 18/node-version: 20/ sleep 120 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: KILL creditcoin-node +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -KILL creditcoin-node +/node-version: 18/node-version: 20/ sleep 120 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: "*.log" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ test-against-fork: +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - setup-self-hosted +/node-version: 18/node-version: 20/ - build-sut +/node-version: 18/node-version: 20/ - fork-creditcoin +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node from current PR +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-fork.json +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-fork.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start a local creditcoin-node from the fork +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --version +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --chain ./creditcoin-fork.json --validator --alice --pruning archive \ +/node-version: 18/node-version: 20/ --base-path /mnt \ +/node-version: 18/node-version: 20/ --monitor-nonce auto >creditcoin-node-with-forked-chain.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for blockchain to start +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Docker engine +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/install-docker-engine-from-upstream.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local Ethereum node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo docker run --name hardhat-dev --rm -p 8545:8545 -d gluwa/hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Prepare for integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd integration-tests/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # wait for creditcoin-node to initialize +/node-version: 18/node-version: 20/ ./yarn-install-and-wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ git checkout yarn.lock +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ sudo apt install -y gcc +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Subwasm +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: install +/node-version: 18/node-version: 20/ args: --locked --git https://github.com/chevdor/subwasm --tag v0.17.1 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download WASM runtime from current PR +/node-version: 18/node-version: 20/ id: download-wasm +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upgrade WASM +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ yarn --cwd ./scripts/js upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ yarn --cwd ./scripts/js runtimeUpgrade ws://127.0.0.1:9944 ../../creditcoin_node_runtime.compact.compressed.wasm //Alice 0 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # TODO: wait & confirm wasm upgrade has finished, incl. migrations +/node-version: 18/node-version: 20/ - name: Execute integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ yarn --cwd ./integration-tests/ test --config creditcoin-fork.config.ts +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: "*.log" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill hardhat-dev +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo docker kill hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill creditcoin-node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # if all went well kill the node. Otherwise GitHub Actions would exit on the +/node-version: 18/node-version: 20/ # previous step killing everything and we don't have to worry about +/node-version: 18/node-version: 20/ # dangling processes +/node-version: 18/node-version: 20/ killall -9 creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ test-against-disconnected-live-node: +/node-version: 18/node-version: 20/ # execute only against Testnet b/c we don't have sudo key for Mainnet +/node-version: 18/node-version: 20/ if: github.base_ref == 'testnet' +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-sut +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - setup-self-hosted +/node-version: 18/node-version: 20/ - live-sync-creditcoin +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node from current PR +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start a disconnected creditcoin-node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # WARNING: using different port b/c the network remembers there was a node +/node-version: 18/node-version: 20/ # at this address previously. We don't want to be connected to the chain !!! +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node \ +/node-version: 18/node-version: 20/ --port 44444 \ +/node-version: 18/node-version: 20/ --name "test-node-disconnected-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ +/node-version: 18/node-version: 20/ --chain ${{ needs.setup.outputs.target_chain }} \ +/node-version: 18/node-version: 20/ --validator --alice --pruning archive \ +/node-version: 18/node-version: 20/ --prometheus-external \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \ +/node-version: 18/node-version: 20/ --base-path /mnt \ +/node-version: 18/node-version: 20/ --monitor-nonce auto >creditcoin-node-disconnected-live-node.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for blockchain to start +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # check this eventhough it should be true unless live-sync screws up! +/node-version: 18/node-version: 20/ - name: Check if creditcoin-node is past block number ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/wait-for-sync.sh ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Docker engine +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/install-docker-engine-from-upstream.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local Ethereum node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo docker run --name hardhat-dev --rm -p 8545:8545 -d gluwa/hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Node.js +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: npm install -g yarn +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Prepare for integration tests +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ pushd integration-tests/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # wait for creditcoin-node to initialize +/node-version: 18/node-version: 20/ ./yarn-install-and-wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ git checkout yarn.lock +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ popd +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Configure rustc version +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ source ci/env +/node-version: 18/node-version: 20/ echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" +/node-version: 18/node-version: 20/ sudo apt install -y gcc +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Rust toolchain +/node-version: 18/node-version: 20/ uses: actions-rs/toolchain@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ toolchain: ${{ env.RUSTC_VERSION }} +/node-version: 18/node-version: 20/ profile: minimal +/node-version: 18/node-version: 20/ override: true +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Subwasm +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: install +/node-version: 18/node-version: 20/ args: --locked --git https://github.com/chevdor/subwasm --tag v0.17.1 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download WASM runtime +/node-version: 18/node-version: 20/ id: download-wasm +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upgrade WASM +/node-version: 18/node-version: 20/ if: env.LENDER_PRIVATE_KEY +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ yarn --cwd ./scripts/js upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ yarn --cwd ./scripts/js runtimeUpgrade ws://127.0.0.1:9944 ../../creditcoin_node_runtime.compact.compressed.wasm "${{ env.LENDER_PRIVATE_KEY }}" 0 +/node-version: 18/node-version: 20/ sleep 10 +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ LENDER_PRIVATE_KEY: ${{ secrets.TESTNET_LENDER_PRIVATE_KEY }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # TODO: wait & confirm wasm upgrade has finished, incl. migrations +/node-version: 18/node-version: 20/ - name: Execute integration tests +/node-version: 18/node-version: 20/ if: env.ETHEREUM_NODE_URL +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ yarn --cwd ./integration-tests/ test --config testnet.config.ts +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ ETHEREUM_NODE_URL: ${{ secrets.TESTNET_ETHEREUM_NODE_URL }} +/node-version: 18/node-version: 20/ LENDER_PRIVATE_KEY: ${{ secrets.TESTNET_LENDER_PRIVATE_KEY }} +/node-version: 18/node-version: 20/ LENDER_SEED: "${{ secrets.TESTNET_LENDER_SEED }}" +/node-version: 18/node-version: 20/ BORROWER_PRIVATE_KEY: ${{ secrets.TESTNET_BORROWER_PRIVATE_KEY }} +/node-version: 18/node-version: 20/ BORROWER_SEED: "${{ secrets.TESTNET_BORROWER_SEED }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: "*.log" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill hardhat-dev +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo docker kill hardhat-dev +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Kill creditcoin-node +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # if all went well kill the node. Otherwise GitHub Actions would exit on the +/node-version: 18/node-version: 20/ # previous step killing everything and we don't have to worry about +/node-version: 18/node-version: 20/ # dangling processes +/node-version: 18/node-version: 20/ killall -9 creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ deploy-github-runner: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ outputs: +/node-version: 18/node-version: 20/ runner_vm_name: ${{ steps.get-env.outputs.runner_vm_name }} +/node-version: 18/node-version: 20/ resource_group: ${{ steps.get-env.outputs.resource_group }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install azure-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt remove azure-cli -y && sudo apt autoremove -y +/node-version: 18/node-version: 20/ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +/node-version: 18/node-version: 20/ sudo apt install -y jq +/node-version: 18/node-version: 20/ az version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Authorize hosted-runner +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ mkdir -p ~/.ssh/ +/node-version: 18/node-version: 20/ ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa +/node-version: 18/node-version: 20/ cat ~/.ssh/id_rsa.pub >> .github/authorized_keys +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Evaluate env vars +/node-version: 18/node-version: 20/ id: get-env +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: using env.RUNNER_VM_NAME directly in job outputs above +/node-version: 18/node-version: 20/ # doesn't evaluate the $GITHUB_RUN_ID reference +/node-version: 18/node-version: 20/ echo "runner_vm_name=${{ env.RUNNER_VM_NAME }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ echo "resource_group=${{ env.RESOURCE_GROUP }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Provision VM +/node-version: 18/node-version: 20/ if: env.LC_GITHUB_REPO_ADMIN_TOKEN +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "INFO: From ENVs: RUNNER_VM_NAME=${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ echo "INFO: From Step: RUNNER_VM_NAME=${{ steps.get-env.outputs.runner_vm_name }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ az login --service-principal --username "${{ secrets.AZURE_APP_ID }}" --password "${{ secrets.AZURE_APP_PASSWORD }}" --tenant "${{ secrets.AZURE_TENANT_ID }}" +/node-version: 18/node-version: 20/ az account set --subscription "Playground Subscription" +/node-version: 18/node-version: 20/ ## az account set -s "${{ secrets.AZURE_SUBSCRIPTION_ID }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # create resource group +/node-version: 18/node-version: 20/ echo "INFO: ${{ steps.get-env.outputs.resource_group }}" +/node-version: 18/node-version: 20/ az group create -n "${{ steps.get-env.outputs.resource_group }}" --location "${{ env.AZ_LOCATION }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # RG Creditcoin-Test is in WestUS and the CPU quota is already full +/node-version: 18/node-version: 20/ # that's why specify a different region here +/node-version: 18/node-version: 20/ az deployment group create -g "${{ steps.get-env.outputs.resource_group }}" -f .github/runner.bicep \ +/node-version: 18/node-version: 20/ --parameters location="${{ env.AZ_LOCATION }}" \ +/node-version: 18/node-version: 20/ --parameters vmName="${{ steps.get-env.outputs.runner_vm_name }}" \ +/node-version: 18/node-version: 20/ --parameters adminPasswordOrKey="$(cat .github/authorized_keys)" > output.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # provision the GitHub Runner binary on the VM +/node-version: 18/node-version: 20/ # passing additional ENV values +/node-version: 18/node-version: 20/ SSH_USER_AT_HOSTNAME=$(jq -r '.properties.outputs.sshUserAtHostname.value' < output.json) +/node-version: 18/node-version: 20/ echo "INFO: $SSH_USER_AT_HOSTNAME" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ export LC_RUNNER_VM_NAME="${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ until ssh -i ~/.ssh/id_rsa \ +/node-version: 18/node-version: 20/ -o SendEnv=LC_GITHUB_REPO_ADMIN_TOKEN,LC_RUNNER_VM_NAME \ +/node-version: 18/node-version: 20/ -o StrictHostKeyChecking=no "$SSH_USER_AT_HOSTNAME" < ./scripts/provision-github-runner.sh; do +/node-version: 18/node-version: 20/ echo "DEBUG: retrying ssh connection ..." +/node-version: 18/node-version: 20/ sleep 30 +/node-version: 18/node-version: 20/ done +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ LC_GITHUB_REPO_ADMIN_TOKEN: ${{ secrets.GH_REPO_ADMIN_TOKEN }} +/node-version: 18/node-version: 20/ LC_RUNNER_EPHEMERAL: false +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ test-migrations-via-try-runtime: +/node-version: 18/node-version: 20/ # see https://gist.github.com/jonico/a94d03cac7a858e0613926d9f1bc7f2b +/node-version: 18/node-version: 20/ runs-on: +/node-version: 18/node-version: 20/ [self-hosted, "${{ needs.deploy-github-runner.outputs.runner_vm_name }}"] +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - build-sut +/node-version: 18/node-version: 20/ - setup +/node-version: 18/node-version: 20/ - setup-self-hosted +/node-version: 18/node-version: 20/ - live-sync-creditcoin +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download creditcoin-node binary from current PR +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-node +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Download WASM runtime +/node-version: 18/node-version: 20/ uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin_node_runtime.compact.compressed.wasm +/node-version: 18/node-version: 20/ path: target/release +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Restore executable permissions +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ chmod a+x ./target/release/creditcoin-node +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Check if runner machine meets chain's requirements +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./scripts/check-hardware.sh +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Start local creditcoin-node for ${{ needs.setup.outputs.target_chain }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # see https://opensource.com/article/18/5/how-find-ip-address-linux +/node-version: 18/node-version: 20/ IP_ADDRESS=$(curl https://ifconfig.me) +/node-version: 18/node-version: 20/ echo "INFO: IP_ADDRESS=$IP_ADDRESS" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node --version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ # node should be reusing the database from the +/node-version: 18/node-version: 20/ # live-sync-creditcoin CI job listed as dependency above +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node \ +/node-version: 18/node-version: 20/ --name "test-node-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ +/node-version: 18/node-version: 20/ --chain ${{ needs.setup.outputs.target_chain }} \ +/node-version: 18/node-version: 20/ --bootnodes "${{ needs.setup.outputs.boot_node }}" \ +/node-version: 18/node-version: 20/ --rpc-max-request-size 200000 \ +/node-version: 18/node-version: 20/ --rpc-max-response-size 200000 \ +/node-version: 18/node-version: 20/ --prometheus-external --pruning archive \ +/node-version: 18/node-version: 20/ --telemetry-url "wss://telemetry.creditcoin.network/submit/ 0" \ +/node-version: 18/node-version: 20/ --base-path /mnt \ +/node-version: 18/node-version: 20/ --public-addr "/dns4/$IP_ADDRESS/tcp/30333" >creditcoin-node-used-for-try-runtime.log 2>&1 & +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Wait for creditcoin-node to initialize +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./integration-tests/wait-for-creditcoin.sh +/node-version: 18/node-version: 20/ ./scripts/wait-for-sync.sh ${{ needs.setup.outputs.last_block_number }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Try-runtime migrations +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ ./target/release/creditcoin-node try-runtime \ +/node-version: 18/node-version: 20/ --runtime ./target/release/creditcoin_node_runtime.compact.compressed.wasm \ +/node-version: 18/node-version: 20/ --dev on-runtime-upgrade live --uri ws://127.0.0.1:9944 \ +/node-version: 18/node-version: 20/ --pallet Creditcoin \ +/node-version: 18/node-version: 20/ --at ${{ needs.setup.outputs.last_block_hash }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: TERM creditcoin-node +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -TERM creditcoin-node +/node-version: 18/node-version: 20/ sleep 60 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: KILL creditcoin-node +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ continue-on-error: true +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ killall -KILL creditcoin-node +/node-version: 18/node-version: 20/ sleep 600 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: logs +/node-version: 18/node-version: 20/ path: "*.log" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ remove-github-runner: +/node-version: 18/node-version: 20/ runs-on: ubuntu-22.04 +/node-version: 18/node-version: 20/ needs: +/node-version: 18/node-version: 20/ - deploy-github-runner +/node-version: 18/node-version: 20/ - test-migrations-via-try-runtime +/node-version: 18/node-version: 20/ - test-against-fork +/node-version: 18/node-version: 20/ - test-against-disconnected-live-node +/node-version: 18/node-version: 20/ if: ${{ always() && needs.deploy-github-runner.result != 'skipped' }} +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Evaluate env vars +/node-version: 18/node-version: 20/ id: get-env +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ # WARNING: using env.RUNNER_VM_NAME directly in job outputs above +/node-version: 18/node-version: 20/ # doesn't evaluate the $GITHUB_RUN_ID reference +/node-version: 18/node-version: 20/ echo "resource_group=${{ env.RESOURCE_GROUP }}" >> "$GITHUB_OUTPUT" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install azure-cli +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ sudo apt remove azure-cli -y && sudo apt autoremove -y +/node-version: 18/node-version: 20/ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +/node-version: 18/node-version: 20/ az version +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Remove VM +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo "INFO: RUNNER_VM_NAME=${{ env.RUNNER_VM_NAME }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ az login --service-principal --username "${{ secrets.AZURE_APP_ID }}" --password "${{ secrets.AZURE_APP_PASSWORD }}" --tenant "${{ secrets.AZURE_TENANT_ID }}" +/node-version: 18/node-version: 20/ az account set --subscription "Playground Subscription" +/node-version: 18/node-version: 20/ az group delete --yes -n "${{ steps.get-env.outputs.resource_group }}" +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Upload logs +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ if: always() +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: "Azure resources" +/node-version: 18/node-version: 20/ path: azure_resource_list.json diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index 3440c48591..3732ac5dfa 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -1,73 +1,146 @@ +/node-version: 18/node-version: 20/ --- +/node-version: 18/node-version: 20/ name: Build WASM Runtime +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ on: +/node-version: 18/node-version: 20/ push: +/node-version: 18/node-version: 20/ branches: [main, testnet, dev] +/node-version: 18/node-version: 20/ pull_request: +/node-version: 18/node-version: 20/ branches: [testnet, dev] +/node-version: 18/node-version: 20/ workflow_dispatch: +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ permissions: read-all +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ jobs: +/node-version: 18/node-version: 20/ build: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ - name: Srtool build +/node-version: 18/node-version: 20/ id: srtool_build +/node-version: 18/node-version: 20/ uses: chevdor/srtool-actions@v0.8.0 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ chain: "creditcoin" +/node-version: 18/node-version: 20/ runtime_dir: runtime +/node-version: 18/node-version: 20/ package: creditcoin-node-runtime +/node-version: 18/node-version: 20/ workdir: ${{ github.workspace }} +/node-version: 18/node-version: 20/ tag: "1.66.1" # FIXME: remove this option (use the latest) once we're building w/ stable rust +/node-version: 18/node-version: 20/ - name: Summary +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ echo '${{ steps.srtool_build.outputs.json }}' | jq . > creditcoin-srtool-digest.json +/node-version: 18/node-version: 20/ cat creditcoin-srtool-digest.json +/node-version: 18/node-version: 20/ echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" +/node-version: 18/node-version: 20/ - name: Archive Runtime +/node-version: 18/node-version: 20/ uses: actions/upload-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-runtime-${{ github.sha }} +/node-version: 18/node-version: 20/ path: | +/node-version: 18/node-version: 20/ ${{ steps.srtool_build.outputs.wasm_compressed }} +/node-version: 18/node-version: 20/ creditcoin-srtool-digest.json +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ update-wasm-on-devnet: +/node-version: 18/node-version: 20/ runs-on: ubuntu-latest +/node-version: 18/node-version: 20/ needs: build +/node-version: 18/node-version: 20/ if: github.ref == 'refs/heads/dev' +/node-version: 18/node-version: 20/ steps: +/node-version: 18/node-version: 20/ - uses: actions/checkout@v4 +/node-version: 18/node-version: 20/ - uses: actions/download-artifact@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ name: creditcoin-runtime-${{ github.sha }} +/node-version: 18/node-version: 20/ path: wasm +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install JS Dependencies +/node-version: 18/node-version: 20/ uses: actions/setup-node@v4 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ node-version: 18 +/node-version: 18/node-version: 20/ - run: | +/node-version: 18/node-version: 20/ npm install -g yarn +/node-version: 18/node-version: 20/ pushd ./creditcoin-js && yarn install && yarn pack && popd +/node-version: 18/node-version: 20/ yarn --cwd ./scripts/js upgrade 'creditcoin-js' +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Install Subwasm +/node-version: 18/node-version: 20/ uses: actions-rs/cargo@v1 +/node-version: 18/node-version: 20/ with: +/node-version: 18/node-version: 20/ command: install +/node-version: 18/node-version: 20/ args: --locked --git https://github.com/chevdor/subwasm --tag v0.17.1 +/node-version: 18/node-version: 20/ +/node-version: 18/node-version: 20/ - name: Update WASM +/node-version: 18/node-version: 20/ working-directory: scripts/js +/node-version: 18/node-version: 20/ env: +/node-version: 18/node-version: 20/ DEVNET_URL: wss://rpc.devnet.creditcoin.network/ws +/node-version: 18/node-version: 20/ SUDO_KEY: ${{ secrets.QA_SUDO_KEY }} +/node-version: 18/node-version: 20/ run: | +/node-version: 18/node-version: 20/ yarn runtimeUpgrade "$DEVNET_URL" \ +/node-version: 18/node-version: 20/ ../../wasm/runtime/target/srtool/release/wbuild/creditcoin-node-runtime/creditcoin_node_runtime.compact.compressed.wasm "$SUDO_KEY" 0 diff --git a/Dockerfile b/Dockerfile index 719a8b9176..42e8059266 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends ca-certificates curl && \ update-ca-certificates && \ - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs --no-install-recommends && \ npm install -g yarn