-
Notifications
You must be signed in to change notification settings - Fork 56
110 lines (107 loc) · 3.02 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
freertos-rust:
name: Build freertos-rust
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings # Warnings disabled only in CI
steps:
- name: Clone
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ runner.arch }}
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
#- name: Format
# run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
#- name: Test
# run: cargo test
#- name: Clippy
# run: cargo clippy -- -Dwarnings
freertos-rust-stable:
name: Build freertos-rust using stable
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings # Warnings disabled only in CI
steps:
- name: Clone
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ runner.arch }}-stable
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --verbose --no-default-features --features=sync,time,hooks,interrupt --package freertos-rust # Don't build the whole workspace because the examples use nightly features which will fail the build
freertos-rust-examples:
name: Build examples
runs-on: ubuntu-latest
strategy:
matrix:
include:
#- example: win
# target: x86_64-pc-windows-gnu
#- example: linux
# target: x86_64-unknown-linux-gnu
#- example: stm32-cortex-m3
# target: thumbv7m-none-eabi
- example: stm32-cortex-m4-blackpill
target: thumbv7em-none-eabihf
#- example: nrf9160
# target: thumbv8m.main-none-eabihf
#env:
# RUSTFLAGS: -D warnings # Warnings disabled only in CI
steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.rustup
target
key: ${{ runner.os }}-${{ runner.arch }}
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- name: Install cross deps
run: |
case ${{ matrix.target }} in
"x86_64-pc-windows-gnu")
sudo apt-get install -y gcc-mingw-w64
;;
"thumbv7m-none-eabi" | "thumbv7em-none-eabihf" | "thumbv8m.main-none-eabihf")
sudo apt-get install -y gcc-arm-none-eabi
;;
esac
- name: Build example
run: cargo build --verbose --example ${{ matrix.example }} --target ${{ matrix.target }}