Short benchmarking in CI with frame-omni-bencher
+ extract chain-spec-builder
stuff to get_preset
#1968
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test all features" | |
on: | |
push: | |
branches: ["main", "release-*"] | |
pull_request: | |
workflow_dispatch: | |
env: | |
FRAME_OMNI_BENCHER_RELEASE_VERSION: polkadot-v1.11.0 | |
# cancel previous runs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
runtime-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
runtime: ${{ steps.runtime.outputs.runtime }} | |
name: Extract runtimes from matrix | |
steps: | |
- uses: actions/checkout@v2 | |
- id: runtime | |
run: | | |
TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' ) | |
echo $TASKS | |
echo "runtime=$TASKS" >> $GITHUB_OUTPUT | |
integration-test-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
itest: ${{ steps.itest.outputs.itest }} | |
name: Extract integration tests from matrix | |
steps: | |
- uses: actions/checkout@v2 | |
- id: itest | |
run: | | |
TASKS=$(echo $(cat .github/workflows/integration-tests-matrix.json) | sed 's/ //g' ) | |
echo $TASKS | |
echo "itest=$TASKS" >> $GITHUB_OUTPUT | |
runtime-test: | |
needs: [runtime-matrix] | |
continue-on-error: true | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install updates and protobuf-compiler | |
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler | |
- name: Free space on the runner | |
run: | | |
df -h | |
sudo apt -y autoremove --purge | |
sudo apt -y autoclean | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set rust version via common env file | |
run: cat .github/env >> $GITHUB_ENV | |
- name: Install stable toolchain | |
run: | | |
rustup install $RUST_STABLE_VERSION | |
rustup default $RUST_STABLE_VERSION | |
rustup target add wasm32-unknown-unknown | |
rustup component add rust-src | |
- name: Fetch cache | |
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | |
with: | |
shared-key: "fellowship-cache-tests" | |
- name: Download frame-omni-bencher | |
run: | | |
curl -sL https://github.com/paritytech/polkadot-sdk/releases/download/$FRAME_OMNI_BENCHER_RELEASE_VERSION/frame-omni-bencher -o frame-omni-bencher | |
chmod +x ./frame-omni-bencher | |
./frame-omni-bencher --version | |
shell: bash | |
- name: Test ${{ matrix.runtime.name }} | |
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
- name: Test all features ${{ matrix.runtime.name }} | |
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-benchmarks,try-runtime | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
SKIP_WASM_BUILD: 1 | |
- name: Test benchmarks ${{ matrix.runtime.name }} | |
run: | | |
PACKAGE_NAME=${{ matrix.runtime.package }} | |
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm | |
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME | |
# build wasm | |
echo "Preparing wasm for benchmarking RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH" | |
cargo build --profile production -p ${{ matrix.runtime.package }} --features=runtime-benchmarks -q --locked | |
ls -lrt $RUNTIME_BLOB_PATH | |
# run benchmarking | |
echo "Running benchmarking for RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH" | |
./frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
integration-test: | |
needs: [integration-test-matrix] | |
continue-on-error: true | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
itest: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }} | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install updates and protobuf-compiler | |
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler | |
- name: Free space on the runner | |
run: | | |
df -h | |
sudo apt -y autoremove --purge | |
sudo apt -y autoclean | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set rust version via common env file | |
run: cat .github/env >> $GITHUB_ENV | |
- name: Install stable toolchain | |
run: | | |
rustup install $RUST_STABLE_VERSION | |
rustup default $RUST_STABLE_VERSION | |
rustup target add wasm32-unknown-unknown | |
rustup component add rust-src | |
- name: Fetch cache | |
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | |
with: | |
shared-key: "fellowship-cache-tests" | |
- name: Test ${{ matrix.itest.name }} | |
run: cargo test -p ${{ matrix.itest.package }} --release --locked -q | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
build-chain-spec-generator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install updates and protobuf-compiler | |
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler | |
- name: Free space on the runner | |
run: | | |
df -h | |
sudo apt -y autoremove --purge | |
sudo apt -y autoclean | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set rust version via common env file | |
run: cat .github/env >> $GITHUB_ENV | |
- name: Install stable toolchain | |
run: | | |
rustup install $RUST_STABLE_VERSION | |
rustup default $RUST_STABLE_VERSION | |
rustup target add wasm32-unknown-unknown | |
rustup component add rust-src | |
- name: Fetch cache | |
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | |
with: | |
shared-key: "fellowship-cache-tests" | |
- name: Build | |
run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks | |
env: | |
RUSTFLAGS: "-C debug-assertions -D warnings" | |
SKIP_WASM_BUILD: 1 | |
zombienet-smoke: | |
needs: [build-chain-spec-generator] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install updates and protobuf-compiler | |
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler | |
- name: Free space on the runner | |
run: | | |
df -h | |
sudo apt -y autoremove --purge | |
sudo apt -y autoclean | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set rust version via common env file | |
run: cat .github/env >> $GITHUB_ENV | |
- name: Install stable toolchain | |
run: | | |
rustup install $RUST_STABLE_VERSION | |
rustup default $RUST_STABLE_VERSION | |
rustup target add wasm32-unknown-unknown | |
rustup component add rust-src | |
- name: Fetch cache | |
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 | |
with: | |
shared-key: "fellowship-cache-integration-tests" | |
- name: Build | |
run: | | |
cargo build -p chain-spec-generator --features fast-runtime --release --locked | |
- name: Zombienet smoke test | |
timeout-minutes: 20 | |
run: | | |
export PATH=$(pwd)/target/release:$PATH | |
cargo test --manifest-path integration-tests/zombienet/Cargo.toml |