Skip to content

Commit

Permalink
Merge branch 'master' into vs/substrate-v0.9.43-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ukint-vs committed Dec 1, 2023
2 parents dcbec86 + 9e8d87d commit be06b0a
Show file tree
Hide file tree
Showing 177 changed files with 6,745 additions and 2,552 deletions.
26 changes: 11 additions & 15 deletions .github/actions/label/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,24 @@ const skip = async ({ core, github }) => {
ref: REF,
});

core.info(`check runs: ${check_runs}`);

const runs = linux
? check_runs.filter(
(run) => run.name === "build" || run.name === "build / linux"
)
: check_runs.filter((run) => run.name === "build / macos-x86");

// Skip this action by default.
let skipped = false;
let skipAction = false;
for (run of runs) {
// Process this action only if the previous build has been skipped.
// If there is already a build, skip this action.
if (
(run.name === "build" && run.conclusion === "skipped")
)
skipped = true;

// If there is already a build, skip this action without more conditions.
if (run.name === "build / linux" || run.name === "build / macos-x86")
return true;
run.name === "build / linux"
|| run.name === "build / macos-x86"
|| (run.name === "build" && run.conclusion !== "skipped")) {
return [true];
}
}

return !skipped;
return [skipAction, JSON.stringify(check_runs, null, 2)];
};

/**
Expand Down Expand Up @@ -147,8 +142,9 @@ const listJobs = async ({ github, core, run_id }) => {
* The main function.
**/
module.exports = async ({ github, core }) => {
if (await skip({ core, github })) {
core.info("Build has already been processed.");
const [skipAction, check_runs] = await skip({ core, github });
if (skipAction) {
core.info("Build has already been processed, check runs: " + check_runs);
return;
}

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ jobs:
- name: "Build: Node"
run: ./scripts/gear.sh build node --release --locked

- name: "Check: Stack height limit"
run: cargo run -p calc-stack-height --release --locked

- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk --release

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "cache: ${CACHE}"
echo "cache=${CACHE}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
TITLE: ${{ github.event.pull_request.title }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:

- name: "Build: Node"
run: cargo build -p gear-cli

- name: "Check: Stack height limit"
run: cargo run -p calc-stack-height --release --locked

- name: "Test: Lazy pages"
run: >-
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
- name: "Check: Vara runtime imports"
run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/vara-runtime/vara_runtime.compact.wasm

- name: "Check: Stack height limit"
run: cargo run -p calc-stack-height --release --locked

- name: "Test: Gear workspace"
run: ./scripts/gear.sh test gear --exclude gclient --exclude gcli --exclude gsdk --release --locked

Expand All @@ -100,7 +103,7 @@ jobs:
# check also lazy-pages benchmarks tests for native runtime
./target/release/gear benchmark pallet --chain=dev --pallet=pallet_gear --extrinsic="check_lazy_pages_all" --execution=native --heap-pages=4096 --extra
- name: "Test: Sys-calls Wasmi integrity"
- name: "Test: Syscalls Wasmi integrity"
run: ./scripts/gear.sh test syscalls --release

- name: "Test: `try-runtime` feature tests"
Expand All @@ -110,7 +113,7 @@ jobs:
- name: "Test: Try runtime migrations"
run: |
cargo build -p gear-cli --features try-runtime --release --locked
./target/release/gear try-runtime --runtime ./target/release/wbuild/vara-runtime/vara_runtime.wasm on-runtime-upgrade --checks live --uri ws://52.32.138.151:9944
./target/release/gear try-runtime --runtime ./target/release/wbuild/vara-runtime/vara_runtime.wasm on-runtime-upgrade --checks live --uri ws://rpc-private.vara-network.io:9944
env:
RUST_LOG: info

Expand Down Expand Up @@ -175,8 +178,6 @@ jobs:
with:
path: artifact

- run: sccache --show-stats

win-cross:
runs-on: [kuberunner, github-runner-03]
env:
Expand Down Expand Up @@ -228,6 +229,11 @@ jobs:
env:
CARGO_BUILD_TARGET: x86_64-pc-windows-msvc

- name: "Check: Stack height limit"
run: cargo xwin run -p calc-stack-height --release --locked
env:
CARGO_BUILD_TARGET: x86_64-pc-windows-msvc

# These tests randomly stops responding

#- name: "Test: Client tests"
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ jobs:
- name: "Check: Compiling gstd on stable"
run: cargo +stable check -p gstd

- run: sccache --show-stats

fuzzer:
runs-on: [kuberunner, github-runner-01]
env:
Expand All @@ -78,6 +76,13 @@ jobs:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4

- name: "MOUNT: Logs path"
run: |
FUZZER_LOGS_PATH=/mnt/fuzzer_logs
sudo mkdir -p $FUZZER_LOGS_PATH
sudo ln -s $FUZZER_LOGS_PATH/artifacts $PWD/utils/runtime-fuzzer/fuzz/artifacts
sudo ln -s $FUZZER_LOGS_PATH/proptest-regressions $PWD/utils/runtime-fuzzer/proptest-regressions
- name: "Install: Set cargo path"
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH

Expand All @@ -90,8 +95,8 @@ jobs:
- name: Install cargo-fuzz
run: cargo install cargo-fuzz

- name: "Check fuzzer with mutation test"
run: ./scripts/check-fuzzer.sh
- name: "Run runtime-fuzzer crate tests"
run: ./scripts/gear.sh test fuzzer-tests

- name: "Check fuzzer reproduction"
run: ./scripts/gear.sh test fuzz-repr
- name: "Check fuzzer competence with mutation test"
run: ./scripts/check-fuzzer.sh
25 changes: 25 additions & 0 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Crates IO

on:
workflow_dispatch:

env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color

jobs:
publish:
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4

- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- name: "Publish packages"
run: cargo run --release -p crates-io-manager
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
LABEL: ${{ github.event.label.name }}
Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ env:
TERM: xterm-256color

jobs:
generate-changelog:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
runs-on: [kuberunner]
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update config
shell: bash
run: sed -E -i "s/\s+\#\s(.*)\s\#\sreplace issue numbers/\\t\1/g" cliff.toml

- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff
Expand All @@ -32,21 +30,8 @@ jobs:
env:
OUTPUT: CHANGES.md

prepare:
needs: generate-changelog
runs-on: ubuntu-latest
steps:
- id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Show version
run: echo ${{ steps.version.outputs.VERSION }}

outputs:
version: ${{ steps.version.outputs.VERSION }}

build:
needs: prepare
needs: changelog
runs-on: [kuberunner]
steps:
- name: "Actions: Checkout"
Expand Down Expand Up @@ -82,7 +67,7 @@ jobs:
run: ./wasm-proc --check-runtime-imports --check-runtime-is-dev false target/production/wbuild/vara-runtime/vara_runtime.compact.wasm

- name: "Artifact: Production `vara-runtime`"
run: cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_runtime_v$VARA_SPEC.wasm"
run: cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/production_vara_runtime_v$VARA_SPEC.wasm"

- name: "Build: Production node client and development `vara-runtime`"
run: cargo build -p gear-cli --profile production
Expand All @@ -92,14 +77,14 @@ jobs:

- name: "Artifact: Production node client and development `vara-runtime`"
run: |
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_devruntime_v$VARA_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/testnet_vara_runtime_v$VARA_SPEC.wasm"
cp target/production/gear artifact/gear
strip artifact/gear || true
- name: Publish
uses: softprops/action-gh-release@v1
with:
body: "${{ needs.generate-changelog.outputs.release_body }}"
body: ${{ needs.changelog.outputs.release_body }}
files: artifact/*
tag_name: ${{ steps.version.outputs.VERSION }}
draft: true
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/gear-tech/node:latest, ${{ needs.tag-image.outputs.image_tag }}
tags: ${{ needs.tag-image.outputs.image_tag }}

- name: SSH into VM
uses: appleboy/ssh-action@v1.0.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
target/
target-no-lazy/
target-xwin/
log/
.binpath
.vscode
Expand Down
Loading

0 comments on commit be06b0a

Please sign in to comment.