Skip to content

Commit

Permalink
Merge pull request #690 from gluwa/testnet
Browse files Browse the repository at this point in the history
Testnet merge to main
  • Loading branch information
jfrank-summit committed Oct 4, 2022
2 parents 7b0845a + 21152c3 commit 30d0b22
Show file tree
Hide file tree
Showing 201 changed files with 23,768 additions and 7,568 deletions.
27 changes: 16 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,59 @@ updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/node"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/node/rpc"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/pallets/creditcoin"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/pallets/difficulty"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/pallets/rewards"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/primitives"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/runtime"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "cargo"
directory: "/sha3pow"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "npm"
directory: "/integration-tests"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "npm"
directory: "/creditcoin-js"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "npm"
directory: "/scripts/js"
schedule:
interval: "weekly"
98 changes: 78 additions & 20 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ on:
branches: testnet

jobs:
hardware-benchmarks:
runs-on: self-hosted
permissions: write-all
steps:
build-benchmarks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 10
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Set env
run: |
echo "HOME=/home/actions" >> $GITHUB_ENV

- name: Inspect benchmark CI config
run: |
Expand All @@ -29,28 +20,73 @@ jobs:
exit 1
fi
- name: Set-Up
run: |
sudo apt-get update
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
- name: Configure rustc version
run: |
source ci/env
echo "RUSTC_VERSION=$RUSTC_VERSION" >> $GITHUB_ENV
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-03-21
toolchain: ${{ env.RUSTC_VERSION }}
target: wasm32-unknown-unknown
profile: minimal
override: true

- uses: Swatinem/rust-cache@v1
continue-on-error: true

- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features runtime-benchmarks

- name: Upload benchmark binary
uses: actions/upload-artifact@v3
with:
name: creditcoin-node
path: target/release/creditcoin-node

hardware-benchmarks:
runs-on: self-hosted
permissions: write-all
needs: build-benchmarks
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 10
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Set env
run: |
echo "HOME=/home/actions" >> $GITHUB_ENV
- name: Download benchmark binary
uses: actions/download-artifact@v3
with:
name: creditcoin-node
path: target/release

- name: Restore executable permissions
run: |
chmod a+x ./target/release/creditcoin-node
- name: Difficulty
shell: bash
continue-on-error: true
continue-on-error: false
env:
PALLET: difficulty
run: |
./scripts/bench.sh -p $PALLET -cb
./scripts/bench.sh -p $PALLET -b
- name: Rewards
shell: bash
continue-on-error: true
continue-on-error: false
env:
PALLET: rewards
run: |
Expand All @@ -59,18 +95,40 @@ jobs:
# Run creditcoin pallet with lesser steps
- name: Creditcoin
shell: bash
continue-on-error: true
continue-on-error: false
env:
STEPS: 8
REPEAT: 8
PALLET: creditcoin
run: |
./scripts/bench.sh -p $PALLET -b -r $REPEAT -s $STEPS
- name: Commit changes
- name: Commit changes to current branch
uses: EndBug/add-and-commit@v9
with:
author_name: hardwareBenchmark
author_email: creditcoin@gluwa.com
message: 'Auto-update pallet weights'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare commit for PR against dev
run: |
LAST_COMMIT=$(git rev-parse HEAD)
BRANCH_NAME=auto-update-weights-for-dev-${{ github.sha }}
git checkout -b $BRANCH_NAME origin/dev
git cherry-pick $LAST_COMMIT
git push origin $BRANCH_NAME
- name: Open PR against dev
id: open_pr
uses: rematocorp/open-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
from-branch: auto-update-weights-for-dev-${{ github.sha }}
to-branch: dev
repository-owner: gluwa
repository: creditcoin

- name: PR number against dev
run: echo ${{ steps.open_pr.outputs.pull_number }}
Loading

0 comments on commit 30d0b22

Please sign in to comment.