-
Notifications
You must be signed in to change notification settings - Fork 83
105 lines (82 loc) · 4.03 KB
/
ci.yml
File metadata and controls
105 lines (82 loc) · 4.03 KB
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "50 6 * * *"
workflow_dispatch:
env:
RUST_TOOLCHAIN: stable
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
crypto-backend: ['rustcrypto', 'mbedtls', 'openssl']
features: ['', 'alloc', 'os']
steps:
- name: Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy, rust-src
- name: Setup | Rust no-std Riscv32 target
run: rustup target add riscv32imac-unknown-none-elf
- name: Setup | Rust no-std Thumbv6 target
run: rustup target add thumbv6m-none-eabi
- name: Setup | Rust no-std Thumbv7 target
run: rustup target add thumbv7em-none-eabi
- name: Install libdbus
run: sudo apt-get install -y libdbus-1-dev
- name: Checkout
uses: actions/checkout@v4
with:
# `cargo xtask copyright` walks `git log --follow` per file
# to derive each header's first/last-edit year span. With the
# default shallow clone (`fetch-depth: 1`) only the synthetic
# PR merge commit is reachable, so every file collapses to
# "today" and the check fails on every PR. `0` = full history.
fetch-depth: 0
- name: Fmt
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo fmt -- --check
- name: Copyright
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo xtask copyright
- name: Xtask Fmt
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cd xtask; cargo fmt -- --check
- name: Clippy - All
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo clippy --no-deps --all-targets -- -Dwarnings
- name: Clippy - baremetal
if: matrix.features == '' && matrix.crypto-backend == 'rustcrypto'
run: cd rs-matter; cargo clippy --no-deps --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},defmt --target riscv32imac-unknown-none-elf -- -Dwarnings
- name: Clippy
run: cd rs-matter; cargo clippy --no-deps --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log -- -Dwarnings
- name: Clippy | defmt
run: export DEFMT_LOG=trace; cd rs-matter; cargo clippy --no-deps --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},defmt -- -Dwarnings
- name: Xtask Clippy
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cd xtask; cargo clippy --no-deps -- -Dwarnings
- name: Build
run: cd rs-matter; cargo build --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log
- name: Benchmark
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cd rs-matter; cargo bench --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log
- name: Test
if: matrix.features == 'os'
run: cd rs-matter; cargo test --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},async-io,log
- name: Examples
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo build --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log,zbus
- name: Examples - Sync Mutex
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo build --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log,zbus,sync-mutex
- name: Examples - WebRTC Camera
if: matrix.features == 'os' && matrix.crypto-backend == 'rustcrypto'
run: cargo build --no-default-features --features ${{matrix.crypto-backend}},${{matrix.features}},log,zbus,webrtc