From 4c16367d9e08b5ac4393f10a1e5df72457b16bc6 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Fri, 18 Nov 2022 14:58:58 +0200 Subject: [PATCH] ci: use cargo cross for armv7 build --- .github/workflows/ci.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7f407a9..edbde62c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,27 @@ jobs: - uses: Swatinem/rust-cache@v2.2.0 - - name: Install compiler for armhf arch - if: matrix.target == 'armv7-unknown-linux-gnueabihf' - run: | - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + target: armv7-unknown-linux-gnueabihf + override: true - name: Build binary - run: | - cargo build -p swap --target ${{ matrix.target }} + if: matrix.target != 'armv7-unknown-linux-gnueabihf' + uses: actions-rs/cargo@v1 + with: + command: build + args: -p swap --target ${{ matrix.target }} + + - name: Build binary (armv7) + if: matrix.target == 'armv7-unknown-linux-gnueabihf' + uses: actions-rs/cargo@v1 + with: + command: build + args: -p swap --target ${{ matrix.target }} + use-cross: true - name: Upload swap binary uses: actions/upload-artifact@v2-preview