-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.68 KB
/
cargo-build.yaml
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
48
49
50
51
52
53
54
on: [push]
name: Auto build
jobs:
fmt:
name: "Run rustfmt"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install toolchain"
run: rustup toolchain install stable --profile minimal -c rustfmt
- name: "Check formatting in root"
run: cargo fmt --all --check
clippy:
name: "Run clippy for ${{ matrix.target }}"
runs-on: ubuntu-latest
strategy:
matrix:
target:
- "stm32g071"
steps:
- uses: actions/checkout@v4
- name: "Install toolchain"
run: rustup toolchain install stable --profile minimal -c rustfmt,clippy -t thumbv6m-none-eabi
- name: "Install libraries and gcc-arm"
run: |
sudo apt-get update
sudo apt-get install libclang-dev llvm-dev gcc-arm-none-eabi
- name: "Run clippy for debug build"
run: cargo clippy --features ${{ matrix.target }} --no-deps -- -D warnings
- name: "Run clippy for release build"
run: cargo clippy --features ${{ matrix.target }} --release --no-deps -- -D warnings
build:
name: "Build for ${{ matrix.target }}"
runs-on: ubuntu-latest
strategy:
matrix:
target:
- "stm32g071"
steps:
- uses: actions/checkout@v4
- name: "Install toolchain"
run: rustup toolchain install stable -t thumbv6m-none-eabi
- name: "Install libraries and gcc-arm"
run: |
sudo apt-get update
sudo apt-get install libclang-dev llvm-dev gcc-arm-none-eabi
- name: "Debug build"
run: cargo build --features ${{ matrix.target }}
- name: "Release build"
run: cargo build --features ${{ matrix.target }} --release