-
Notifications
You must be signed in to change notification settings - Fork 242
107 lines (107 loc) · 3.55 KB
/
build_and_test.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
on: [push, pull_request]
name: Build and Test check
jobs:
rp2040-hal-builds:
name: Build rp2040-hal's features
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Build rp2040-hal's workspace (without the examples)
run: cargo hack build --optional-deps --each-feature
examples-builds:
name: Build rp2040-hal's examples
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Build workspace
run: cargo hack build --examples --optional-deps --each-feature
tests:
name: Execute host-runable tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Test
run: cargo hack test -p rp2040-hal --tests --target x86_64-unknown-linux-gnu --optional-deps --each-feature --features critical-section-impl
- name: Test docs
run: cargo hack test -p rp2040-hal --doc --target x86_64-unknown-linux-gnu --optional-deps --each-feature --features critical-section-impl
- name: Test macros
run: cargo hack test -p rp2040-hal-macros --tests --target x86_64-unknown-linux-gnu --optional-deps --each-feature
- name: Test macro docs
run: cargo hack test -p rp2040-hal-macros --doc --target x86_64-unknown-linux-gnu --optional-deps --each-feature
- name: Clean
run: cargo clean
udeps:
name: Check rp2040-hal for unused dependencies
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-06-27
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Install cargo-udeps
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-udeps
version: "=0.1.40"
- name: Check unused deps
run: cargo hack udeps --optional-deps --each-feature
msrv:
name: Verifiy build on MSRV
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.65
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Use older version of regex
run: cargo update -p regex --precise 1.9.3
- name: Verifiy MSRV
run: cargo hack build --examples --optional-deps --each-feature
on-target-build:
name: Build on-target-tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Build on-target-tests
run: |
cd on-target-tests
cargo test --no-run