-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (102 loc) · 2.7 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
name: Rust
on:
push:
branches:
- 'main'
- '**'
pull_request:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
targets: thumbv7em-none-eabihf, x86_64-unknown-linux-gnu
- name: run format
run: ./scripts/check_fmt.sh
shell: bash
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
targets: thumbv7em-none-eabihf, x86_64-unknown-linux-gnu
- name: check code
run: ./scripts/check_code.sh
shell: bash
build:
name: Build
strategy:
fail-fast: false
matrix:
include:
- TARGET: thumbv7em-none-eabihf
FEATURES: use-aerugo-cortex-m
- TARGET: x86_64-unknown-linux-gnu
FEATURES: use-aerugo-x86
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.TARGET }}
- name: cargo build
run: cargo build -p aerugo --features ${{ matrix.FEATURES }}
build-hal-tests:
name: Build HAL integration tests
runs-on: ubuntu-latest
needs: [rustfmt, clippy, build]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf
- name: cargo build (HAL tests)
run: ./scripts/build_hal_tests.sh
shell: bash
tests:
name: Run tests
runs-on: ubuntu-latest
needs: [rustfmt, clippy, build]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf, x86_64-unknown-linux-gnu
- name: run tests
run: ./scripts/run_tests.sh
shell: bash
examples:
name: Build examples
runs-on: ubuntu-latest
needs: [rustfmt, clippy, build]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf, x86_64-unknown-linux-gnu
- name: build examples
run: ./scripts/build_examples.sh
shell: bash
docs:
name: Generate docs
runs-on: ubuntu-latest
needs: [rustfmt, clippy, build]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv7em-none-eabihf
- name: generate docs
run: ./scripts/generate_docs.sh
shell: bash