Skip to content

Commit

Permalink
Use rpi compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
flxkrmr authored Feb 18, 2024
1 parent 43b9bdf commit 3b88eed
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: arm-unknown-linux-musleabihf
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: 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: 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: Upload binary
uses: actions/upload-artifact@v2
with:
name: boiler-watch-api_arm-linux-musleabihf
path: target/arm-unknown-linux-musleabihf/release/boiler-watch-api
name: boiler-watch-api_arm-linux-gnueabihf
path: target/arm-unknown-linux-gnueabihf/release/boiler-watch-api

0 comments on commit 3b88eed

Please sign in to comment.