diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index dc3b1fe8e1..380afd44e0 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -38,13 +38,13 @@ jobs: cache-version: v1 - name: Build binary and runtime - run: cargo build --release -p aleph-node + run: cargo build --profile production -p aleph-node - name: Upload release binary uses: actions/upload-artifact@v2 with: name: ${{ inputs.artifact-prefix }}aleph-release-node - path: target/release/aleph-node + path: target/production/aleph-node if-no-files-found: error retention-days: 7 @@ -52,7 +52,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ inputs.artifact-prefix }}aleph-release-runtime - path: target/release/wbuild/aleph-runtime/aleph_runtime.compact.wasm + path: target/production/wbuild/aleph-runtime/aleph_runtime.compact.wasm if-no-files-found: error retention-days: 7 diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 1701afbf99..084e3d675e 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -78,13 +78,13 @@ jobs: - name: Build runtime and compare checksum with artifact env: ARTIFACT: aleph_runtime.compact.wasm - TARGET_DIR: target/release/wbuild/aleph-runtime + TARGET_DIR: target/production/wbuild/aleph-runtime run: | mkdir -p "$TARGET_DIR" mv "$ARTIFACT" "$TARGET_DIR" sha256sum "$TARGET_DIR/$ARTIFACT" > checksum.sha256 cargo clean - cargo build --release -p aleph-runtime + cargo build --profile production -p aleph-runtime sha256sum -c checksum.sha256 @@ -554,7 +554,7 @@ jobs: then echo "::set-output name=diff::0" else - echo "::set-output name=diff::1" + echo "::set-output name=diff::1" fi build-new-runtime-and-try_runtime: diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index af2f1ab1b4..08cb2e2a14 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -26,14 +26,14 @@ jobs: with: name: aleph-test-node path: target/release - + - name: Build test docker image id: build-image run: | chmod +x target/release/aleph-node docker build --tag aleph-node:latest -f ./docker/Dockerfile . docker save -o aleph-node.tar aleph-node:latest - + - name: Upload test docker image uses: actions/upload-artifact@v2 with: @@ -51,7 +51,7 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v2 - + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 @@ -62,17 +62,17 @@ jobs: uses: actions/download-artifact@v2 with: name: aleph-release-runtime - + - name: Build runtime and compare checksum with artifact env: ARTIFACT: aleph_runtime.compact.wasm - TARGET_DIR: target/release/wbuild/aleph-runtime + TARGET_DIR: target/production/wbuild/aleph-runtime run: | mkdir -p "$TARGET_DIR" mv "$ARTIFACT" "$TARGET_DIR" sha256sum "$TARGET_DIR/$ARTIFACT" > checksum.sha256 cargo clean - cargo build --release -p aleph-runtime + cargo build --profile production -p aleph-runtime sha256sum -c checksum.sha256 build-test-client: @@ -83,10 +83,10 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v2 - + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 - + - name: Restore cache uses: ./.github/actions/restore-cache with: @@ -94,17 +94,17 @@ jobs: cargo-key: e2e cache-version: v1 cargo-targets: e2e-tests/target/ - + - name: Build binary and docker image run: | cd e2e-tests/ - cargo build --release + cargo build docker build --tag aleph-e2e-client:latest -f Dockerfile . docker save -o aleph-e2e-client.tar aleph-e2e-client:latest - + - name: Stop cache uses: ./.github/actions/post-cache - + - name: Upload artifact uses: actions/upload-artifact@v2 with: diff --git a/Cargo.toml b/Cargo.toml index 3bfbfd9c75..36b4491e69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,3 +19,12 @@ exclude = [ "benches/payout-stakers", "bin/cliain", ] + +[profile.release] +# Substrate runtime requires unwinding. +panic = "unwind" + +[profile.production] +inherits = "release" +lto = true +codegen-units = 1