Skip to content

Add arm package

Add arm package #36

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Tests
run: cargo test
- name: Set up Rust for Raspberry Pi cross-compilation
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: arm-unknown-linux-gnueabihf
#- name: Install dependencies for cross-compilation
# run: sudo apt-get install -y musl-dev musl-tools gcc-arm-linux-gnueabihf
#- run: git clone --depth=1 https://github.com/raspberrypi/tools.git rpi-tools
#- run: export RPI_GCC=rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
#- run: CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=$RPI_GCC TARGET_CC=$RPI_GCC cargo build --target=arm-unknown-linux-gnueabihf --release
#- name: Build binary for Raspberry Pi
# run: CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-ld REALGCC=gcc-arm-linux-gnueabihf TARGET_CC=musl-gcc cargo build --release --target=arm-unknown-linux-musleabihf
- name: Install ARM target for Rust
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Install dependencies for cross-compiling
run: sudo apt-get update && sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Build the project
run: cargo build --release --target=armv7-unknown-linux-gnueabihf
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: boiler-watch-api_arm-linux-gnueabihf
path: target/arm-unknown-linux-gnueabihf/release/boiler-watch-api