aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/rust.yaml
blob: fa2d6247559de9455fd03db168efba98a55ca3e7 (plain)
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
55
56
57
58
59
60
61
62
63
64
name: Rust CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: rustup toolchain install stable --no-self-update --profile minimal
    - name: Check formatting
      run: cargo fmt --verbose --all --check

  clippy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install a stable toolchain with clippy
      run: rustup toolchain install stable --no-self-update --profile minimal --component clippy
    - name: Lint the host API
      run: cargo clippy --package=imxrt-rt --tests -- -D warnings

  tests:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv7em-none-eabihf
    - name: Run doc tests
      run: cargo test --doc
    - name: Run automated tests
      run: cargo test --tests -- --include-ignored
    - name: Install ARM GCC
      run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi
    - name: Check binaries that are linked with GNU's ld
      env:
        CARGO_TARGET_THUMBV7EM_NONE_EABIHF_RUSTFLAGS: "-C linker=arm-none-eabi-gcc -C link-arg=-mcpu=cortex-m7 -C link-arg=-mfloat-abi=hard -C link-arg=-mfpu=fpv5-d16 -C link-arg=-nostartfiles"
      run: cargo test --tests -- --ignored

  boards:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        board: [ teensy4, imxrt1010evk, imxrt1170evk-cm7 ]
    steps:
    - uses: actions/checkout@v2
    - run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv7em-none-eabihf --component clippy
    - name: Lint the RTIC example for ${{ matrix.board }}
      run: cargo clippy --example=blink-rtic --target=thumbv7em-none-eabihf --features=board/${{ matrix.board }},board/rtic -- -D warnings
    - name: Lint the blocking example ${{ matrix.board }}
      run: cargo clippy --example=blink-blocking --target=thumbv7em-none-eabihf --features=board/${{ matrix.board }} -- -D warnings

  docs:
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
    - uses: actions/checkout@v2
    - run: rustup toolchain install stable --no-self-update --profile minimal
    - name: Check host documentation
      run: cargo rustdoc --package=imxrt-rt