Skip to content

Commit

Permalink
fix benchmakr build and add that build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jul 30, 2023
1 parent 45bf961 commit 1af2c61
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,48 @@ jobs:
name: encointer-collator-${{ github.sha }}
path: target/release/encointer-collator

build_try_runtime_and_benchmark_binaries:
name: extra flags build ${{ matrix.binary }} for ${{ matrix.rust-target }} on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
rust: [stable]
binary: [release]
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
TARGET: ${{ matrix.rust-target }}
RUST_BIN_DIR: target/${{ matrix.rust-target }}/debug
RELEASE_NAME: debug
steps:
- uses: actions/checkout@v3
- name: Install protoc
run: sudo apt-get install protobuf-compiler

- name: Print env
run: |
echo "RUST_BIN_DIR = ${{ env.RUST_BIN_DIR }} "
# With rustup's nice new toml format, we just need to run rustup show to install the toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
- name: Setup Rust toolchain
run: rustup show

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}-${{ matrix.binary }}

- name: Release
if: ${{ matrix.binary == 'release' }}
run: cargo build --locked --release --features try-runtime,runtime-benchmarks

# Upload artifacts
- name: Upload encointer-collator
uses: actions/upload-artifact@v3
with:
name: encointer-collator-benchmark-try-runtime-${{ github.sha }}
path: target/release/encointer-collator

# Run all checks and unit test. This always run on debug mode
check:
Expand Down Expand Up @@ -134,7 +176,7 @@ jobs:

- name: Install protoc
run: sudo apt-get install protobuf-compiler

- name: Cache target dir
uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions polkadot-parachains/encointer-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"hex-literal",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down
4 changes: 2 additions & 2 deletions polkadot-parachains/launch-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking",
"frame-system-benchmarking/runtime-benchmarks",
"hex-literal",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down

0 comments on commit 1af2c61

Please sign in to comment.