-
Notifications
You must be signed in to change notification settings - Fork 34
172 lines (163 loc) · 7.18 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Check Rust code
on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain with rustfmt
run: rustup toolchain install stable --no-self-update --profile minimal --component rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
# Checks the common HAL for all chips supported by imxrt-ral.
lint-hal:
needs: format
strategy:
matrix:
chips:
- imxrt-ral/imxrt1011
- imxrt-ral/imxrt1015
- imxrt-ral/imxrt1021
- imxrt-ral/imxrt1051
- imxrt-ral/imxrt1052
- imxrt-ral/imxrt1061
- imxrt-ral/imxrt1062
- imxrt-ral/imxrt1064
- imxrt-ral/imxrt1176_cm4
- imxrt-ral/imxrt1176_cm7
- imxrt-ral/imxrt1189_cm7
- imxrt-ral/imxrt1189_cm33
# We can't lint the 1180 through lint-log. The logging package
# requires DMA-capable LPUART, and there's no DMA support for
# the 1180.
- imxrt-ral/imxrt1189_cm33,imxrt1180
- imxrt-ral/imxrt1189_cm7,imxrt1180
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain with clippy
run: rustup toolchain install stable --no-self-update --profile minimal --component clippy
- name: Lint imxrt-hal
run: cargo clippy --features=${{ matrix.chips }} --package=imxrt-hal -- -D warnings
# Indirectly checks & lints the HAL with the HAL's chip feature, and also
# checks & lints the imxrt-log package.
lint-log:
needs: lint-hal
strategy:
matrix:
chips:
- imxrt-ral/imxrt1011,imxrt1010
- imxrt-ral/imxrt1021,imxrt1020
- imxrt-ral/imxrt1061,imxrt1060
- imxrt-ral/imxrt1062,imxrt1060
- imxrt-ral/imxrt1064,imxrt1060
- imxrt-ral/imxrt1176_cm4,imxrt1170
- imxrt-ral/imxrt1176_cm7,imxrt1170
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain with clippy
run: rustup toolchain install stable --no-self-update --profile minimal --component clippy
- name: Lint imxrt-log
run: cargo clippy --features=${{ matrix.chips }} --package=imxrt-log --package=imxrt-hal -- -D warnings
# Lint and build examples for boards.
examples:
needs: lint-hal
strategy:
matrix:
config:
# Boards that support all examples, and should build with additional drivers.
- --examples --features=board/teensy4,board/lcd1602
- --examples --features=board/imxrt1010evk,board/lcd1602
- --examples --features=board/imxrt1060evk,board/lcd1602
# SPI examples (might break other examples)
- --example=rtic_spi_blocking --example=rtic_spi_controller --example=rtic_spi_peripheral --example=rtic_spi --example=async_dma_spi --features=board/teensy4,board/spi
- --example=rtic_spi_blocking --example=rtic_spi_controller --example=rtic_spi_peripheral --example=rtic_spi --example=async_dma_spi --features=board/imxrt1010evk,board/spi
- --example=rtic_spi_blocking --example=rtic_spi_controller --example=rtic_spi_peripheral --example=rtic_spi --example=async_dma_spi --features=board/imxrt1060evk,board/spi
- --example=rtic_spi_blocking --example=rtic_spi_controller --example=rtic_spi_peripheral --example=rtic_spi --example=async_dma_spi --features=board/imxrt1170evk-cm7,board/spi
# The i.MX RT 1170 EVK (CM7) target is WIP. The list below describes the working examples.
- --features=board/imxrt1170evk-cm7,board/lcd1602 --example=hal_led
--example=hal_gpio_input --example=rtic_gpio_input
--example=hal_uart --example=rtic_uart --example=rtic_dma_uart --example=async_dma_uart
--example=hal_gpt --example=rtic_gpt
--example=hal_pit --example=rtic_pit
--example=hal_logging --example=rtic_logging
--example=hal_clock_out
--example=hal_pwm --example=rtic_pwm
--example=hal_i2c_mpu9250 --example=hal_i2c_lcd1602
--example=rtic_usb_serial --example=rtic_usb_test_class --example=rtic_usb_keypress --example=rtic_usb_mouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain, clippy, for the MCU target
run: rustup toolchain install stable --no-self-update --profile minimal --component clippy --target thumbv7em-none-eabihf
- name: Lint board and examples
run: cargo clippy ${{ matrix.config }} --target=thumbv7em-none-eabihf -- -D warnings
- name: Build examples
run: cargo build ${{ matrix.config }} --target=thumbv7em-none-eabihf --release
# For now, we let the 1180EVK examples build with warnings. It's very WIP.
examples-1180-evk:
needs: lint-hal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain for the MCU target
run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv8m.main-none-eabihf
- name: Build examples
run: >
cargo build --features=board/imxrt1180evk-cm33 --target=thumbv8m.main-none-eabihf --release
--example=hal_led
# Run unit, integration tests.
#
# Select just one compatible RAL feature to pair with the HAL. The goal is to
# cover all HAL configurations just once. The linting job gives us complete
# build coverage.
#
# This ends up testing imxrt-log multiple times. That's OK.
tests:
needs: format
strategy:
matrix:
chips:
- imxrt-ral/imxrt1011,imxrt1010
- imxrt-ral/imxrt1021,imxrt1020
- imxrt-ral/imxrt1062,imxrt1060
- imxrt-ral/imxrt1176_cm7,imxrt1170
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain
run: rustup toolchain install stable --no-self-update --profile minimal
- name: Run unit, integration tests
run: cargo test --features=${{ matrix.chips }} --tests --package=imxrt-hal --package=imxrt-log
# Make sure our unit tests can pass (some recent version of) miri.
miri:
needs: tests
strategy:
matrix:
chips:
- imxrt-ral/imxrt1011,imxrt1010
- imxrt-ral/imxrt1021,imxrt1020
- imxrt-ral/imxrt1062,imxrt1060
- imxrt-ral/imxrt1176_cm7,imxrt1170
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install a nightly toolchain with miri
run: rustup toolchain install nightly --no-self-update --profile minimal --component miri
- name: Run unit, integration tests with miri
run: cargo +nightly miri test --features=${{ matrix.chips }} --tests --package=imxrt-hal --package=imxrt-log --config "profile.dev.opt-level = 0"
# Ensures that documentation builds, and that links are valid
docs:
needs: format
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
- name: Install a stable toolchain
run: rustup toolchain install stable --no-self-update --profile minimal
- name: Run documentation tests
run: cargo test --features=board/teensy4 --workspace --doc
- name: Check documentation, doclinks throughout workspace
run: cargo doc --workspace --no-deps --features=board/teensy4