Skip to content

Commit

Permalink
Merge branch 'master' into ms/issue-3217
Browse files Browse the repository at this point in the history
  • Loading branch information
mqxf authored Sep 19, 2023
2 parents b3c8c50 + 5166948 commit 2626a33
Show file tree
Hide file tree
Showing 169 changed files with 7,885 additions and 8,268 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ jobs:
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
--features=lazy-pages
--release
upload:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ jobs:
run: curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

- name: "Build: Node"
run: >-
cargo build
-p gear-cli --features=lazy-pages
run: cargo build -p gear-cli

- name: "Test: Lazy pages"
run: >-
cargo nextest run
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
--features=lazy-pages
16 changes: 6 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: ./scripts/gear.sh init cargo

- name: "Build: Gear"
run: ./scripts/gear.sh build gear --locked --release
run: ./scripts/gear.sh build gear -F gear-cli/dev --locked --release

- name: "Build fuzzer"
run: ./scripts/gear.sh build fuzz --locked --release
Expand All @@ -77,11 +77,8 @@ jobs:
- name: "Check: Vara runtime imports"
run: ./target/release/wasm-proc --check-runtime-imports target/release/wbuild/vara-runtime/vara_runtime.compact.wasm

- name: "Test: Gear pallet tests with lazy pages"
run: ./scripts/gear.sh test pallet --features lazy-pages --release --locked

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

- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk --release
Expand All @@ -96,7 +93,7 @@ jobs:

- name: "Test: Runtime benchmarks and benchmark tests work"
run: |
cargo build -p gear-cli --release --features=runtime-benchmarks,runtime-benchmarks-checkers
cargo build -p gear-cli --release --features=dev,runtime-benchmarks,runtime-benchmarks-checkers
# check that perf benchmarks works. `--steps=20` need to test, that benchmarks works for different input number.
./target/release/gear benchmark pallet --chain=dev --pallet=pallet_gear --steps=20 --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096
# check that read_big_state benchmarks works
Expand All @@ -111,11 +108,11 @@ jobs:

- name: "Test: `try-runtime` feature tests"
run: |
cargo test -p "pallet-*" --features try-runtime --release --locked
cargo test -p "pallet-*" --features try-runtime,dev --release --locked
- name: "Test: Try runtime migrations"
run: |
cargo build -p gear-cli --features try-runtime --release --locked
cargo build -p gear-cli --features try-runtime,dev --release --locked
./target/release/gear try-runtime --runtime ./target/release/wbuild/gear-runtime/gear_runtime.wasm on-runtime-upgrade --checks live --uri wss://rpc-private-testnet.gear-tech.io:443
env:
RUST_LOG: info
Expand Down Expand Up @@ -158,7 +155,7 @@ jobs:

- name: "Build: Production binaries"
if: github.event_name == 'push'
run: cargo build -p gear-cli -F cli --profile production
run: cargo build -p gear-cli -F dev,cli --profile production

- name: Prepare artifacts
if: github.event_name == 'push'
Expand Down Expand Up @@ -252,7 +249,6 @@ jobs:
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
--features=lazy-pages
--release
env:
CARGO_BUILD_TARGET: x86_64-pc-windows-msvc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: ./scripts/gear.sh clippy examples --all-targets --locked

- name: "Test: Doc tests"
run: ./scripts/gear.sh test doc
run: ./scripts/gear.sh test docs

- name: "Test: Changes in gsdk generated code"
run: |
Expand Down
53 changes: 37 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,67 @@ jobs:
needs: prepare
runs-on: [kuberunner]
steps:
- name: Checkout
- name: "Actions: Checkout"
uses: actions/checkout@v4

- name: Set cargo path
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Environment: Cargo path"
run: >
echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- name: Install build deps
- name: "Install: Build dependencies"
run: |
sudo apt update -y
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2
- name: Build wasm-proc
- name: "Environment: Export versions"
run: |
export GEAR_SPEC="$(cat runtime/gear/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')"
export VARA_SPEC="$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')"
- name: "Artifact: Make `artifact` directory"
run: >
mkdir -p artifact
- name: "Build: `wasm-proc`"
run: |
cargo build -p wasm-proc --release
cp -vf target/release/wasm-proc ./
- name: Build binaries
- name: "Build: Production `gear-cli`"
run: >
cargo build -p gear-cli --profile production
- name: Test runtimes
- name: "Test: Production runtimes"
run: |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm
- name: Prepare artifacts
- name: "Artifact: Production binaries"
run: |
mkdir -p artifact
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.compact.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.wasm artifact/
cp target/production/gear artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/gear_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/vara_v$VARA_SPEC.wasm"
cp target/production/gear artifact/gear
strip artifact/gear || true
- name: "Build: Development `gear-cli`"
run: >
cargo build -p gear-cli --profile production -F dev
- name: "Test: Development runtimes"
run: |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm
- name: "Artifact: Development binaries"
run: |
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm "artifact/dev_gear_v$GEAR_SPEC.wasm"
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/dev_vara_v$VARA_SPEC.wasm"
cp target/production/gear artifact/dev-gear
strip artifact/dev-gear || true
- name: Publish
uses: softprops/action-gh-release@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-measurements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
tar -xf /cache/check_cargo_registry_${{ github.ref_name }}.tar -C /
- name: "Build: Gear"
run: ./scripts/gear.sh build gear --release --locked --features=runtime-benchmarks,lazy-pages
run: ./scripts/gear.sh build gear --release --locked --features=dev,runtime-benchmarks

- name: "Collect: Gear workspace tests"
run: |
mkdir -p ./target/analysis/tests/
mkdir -p ./target/analysis/output/
for i in `seq 1 $COUNT`; do echo $i; ./scripts/gear.sh test gear --exclude gclient --exclude gcli --features pallet-gear-debug/lazy-pages --release -j1 > ./target/analysis/output/$i 2>&1 ; mv ./target/nextest/ci/junit.xml ./target/analysis/tests/$i; done
for i in `seq 1 $COUNT`; do echo $i; ./scripts/gear.sh test gear --exclude gclient --exclude gcli --release -j1 > ./target/analysis/output/$i 2>&1 ; mv ./target/nextest/ci/junit.xml ./target/analysis/tests/$i; done
./target/release/regression-analysis collect-data --data-folder-path ./target/analysis/tests/ --output-path ./target/pallet-tests.json
- name: "Generate report: Gear workspace tests"
Expand Down
Loading

0 comments on commit 2626a33

Please sign in to comment.