From 3577f2eb9e3db5ef35e0ce0813925d7c1115cfc7 Mon Sep 17 00:00:00 2001 From: Matthew Orris <--help> Date: Wed, 6 Mar 2024 16:59:59 -0700 Subject: [PATCH] wip: Add cross-build job to GitHub workflow --- .../workflows/publish-dev-ci-base-image.yml | 2 +- .github/workflows/verify-pr-commit.yml | 43 +++++++++++++++++++ pallets/capacity/src/lib.rs | 2 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-dev-ci-base-image.yml b/.github/workflows/publish-dev-ci-base-image.yml index 7c34ebb7d0..a876d70714 100644 --- a/.github/workflows/publish-dev-ci-base-image.yml +++ b/.github/workflows/publish-dev-ci-base-image.yml @@ -8,7 +8,7 @@ on: push: branches: - disabled-as-this-branch-does-not-exist - - 779-build-arm-binaries-and-containers-for-linux-and-macos + # - 779-build-arm-binaries-and-containers-for-linux-and-macos # - 1639-upgrade-to-polkadot-release-v100 env: BIN_DIR: target/release diff --git a/.github/workflows/verify-pr-commit.yml b/.github/workflows/verify-pr-commit.yml index 1baeb52f38..c35154d42c 100644 --- a/.github/workflows/verify-pr-commit.yml +++ b/.github/workflows/verify-pr-commit.yml @@ -106,6 +106,49 @@ jobs: steps: - run: echo "Just a dummy matrix to satisfy GitHub required checks that were skipped" + cross-build: + # needs: changes + # if: needs.changes.outputs.rust == 'true' + name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }} + runs-on: ${{ matrix.platform.os }} + strategy: + fail-fast: false + matrix: + platform: + - os_name: Linux-aarch64 + os: ubuntu-22.04 + target: aarch64-unknown-linux-musl + binary: frequency + - os_name: Linux-x86_64 + os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + binary: frequency + - os_name: macOS-x86_64 + os: macOS-latest + target: x86_64-apple-darwin + binary: frequency + - os_name: macOS-aarch64 + os: macOS-latest + target: aarch64-apple-darwin + binary: frequency + toolchain: + - stable + steps: + - run: echo "Cross Build ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}" + - uses: actions/checkout@v4 + - name: Build Binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: "build" + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--release --features frequency-no-relay" + strip: true + # - name: Rename Binary (linux and macos) + # run: mv target/${{ matrix.platform.target }}/release/frequency ${{ matrix.platform.binary }} + # if: matrix.platform.os_name + + build-binaries: needs: changes if: needs.changes.outputs.build-binary == 'true' diff --git a/pallets/capacity/src/lib.rs b/pallets/capacity/src/lib.rs index 234a80b2a6..1e2993d60a 100644 --- a/pallets/capacity/src/lib.rs +++ b/pallets/capacity/src/lib.rs @@ -48,6 +48,8 @@ missing_docs )] +// REMOVE: need to touch rs file for testing + use frame_support::{ ensure, traits::{