-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (35 loc) · 1.22 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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: Add sources for armhf
# run: sudo sh -c 'cat .github/artifacts/sources.list > /etc/apt/sources.list'
- name: Lets have a look
run: sudo sh -c 'cat /etc/apt/sources.list'
#- name: Prepare for cross compilation
# run: sudo dpkg --add-architecture armhf && sudo apt-get update
- name: Install dependencies for cross-compilation
run: sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross libsqlite3-dev:armhf
- name: Build binary for Raspberry Pi
run: cargo build --release --target=arm-unknown-linux-gnueabihf
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: boiler-watch-api
path: target/arm-unknown-linux-gnueabihf/release/boiler-watch-api