Skip to content

Commit 8e5ef25

Browse files
korken89Johannes Draaijer
authored andcommitted
Run doctests on CI
1 parent f1d119d commit 8e5ef25

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,37 @@ jobs:
3333
command: fmt
3434
args: --all -- --check
3535

36-
# Compilation
36+
# Run cargo test
37+
test:
38+
name: test
39+
strategy:
40+
matrix:
41+
target:
42+
- x86_64-unknown-linux-gnu
43+
toolchain:
44+
- stable
45+
features:
46+
- stm32f745,smi
47+
runs-on: ubuntu-20.04
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
52+
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
53+
uses: actions-rs/toolchain@v1
54+
with:
55+
toolchain: ${{ matrix.toolchain }}
56+
target: ${{ matrix.target }}
57+
override: true
58+
59+
- name: cargo test the documentation and readme
60+
uses: actions-rs/cargo@v1
61+
with:
62+
command: test
63+
args: --target=${{ matrix.target }} --features ${{ matrix.features }}
64+
65+
66+
# Compilation
3767
build:
3868
name: build
3969
runs-on: ubuntu-20.04
@@ -43,7 +73,7 @@ jobs:
4373
- x86_64-unknown-linux-gnu
4474
toolchain:
4575
- stable
46-
features:
76+
features:
4777
- stm32f107,smi
4878
- stm32f407,smi
4979
- stm32f417,smi
@@ -79,7 +109,7 @@ jobs:
79109
with:
80110
use-cross: false
81111
command: build
82-
args: --target=${{ matrix.target }} --features ${{ matrix.features }}
112+
args: --target=${{ matrix.target }} --features ${{ matrix.features }}
83113

84114
# Examples
85115
examples:
@@ -114,28 +144,28 @@ jobs:
114144
with:
115145
use-cross: false
116146
command: build
117-
args: --target=${{ matrix.target }} --example ip --features stm32f429,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
118-
147+
args: --target=${{ matrix.target }} --example ip --features stm32f429,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
148+
119149
- name: cargo build f4 example arp
120150
uses: actions-rs/cargo@v1
121151
with:
122152
use-cross: false
123153
command: build
124-
args: --target=${{ matrix.target }} --example arp --features stm32f407,smi
125-
154+
args: --target=${{ matrix.target }} --example arp --features stm32f407,smi
155+
126156
- name: cargo build f4 example arp-smoltcp
127157
uses: actions-rs/cargo@v1
128158
with:
129159
use-cross: false
130160
command: build
131161
args: --target=${{ matrix.target }} --example arp-smoltcp --features stm32f407,smi,smoltcp-phy,smoltcp/socket-icmp
132-
162+
133163
- name: cargo build f1 example ip
134164
uses: actions-rs/cargo@v1
135165
with:
136166
use-cross: false
137167
command: build
138-
args: --target=${{ matrix.target }} --example ip-f107 --features stm32f107,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
168+
args: --target=${{ matrix.target }} --example ip-f107 --features stm32f107,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
139169

140170
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
141171
#
@@ -147,6 +177,7 @@ jobs:
147177
needs:
148178
- style
149179
- build
180+
- test
150181
- examples
151182
runs-on: ubuntu-20.04
152183
steps:

0 commit comments

Comments
 (0)