Skip to content

Commit d4afbdf

Browse files
author
tac0turtle
committed
update libs and add no_std
1 parent 772eec4 commit d4afbdf

File tree

10 files changed

+768
-952
lines changed

10 files changed

+768
-952
lines changed

.github/actions/rust-setup/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: "Additional cache key for dependencies"
1414
required: false
1515
default: "default"
16+
targets:
17+
description: "Additional targets to install (e.g., thumbv7m-none-eabi)"
18+
required: false
19+
default: ""
1620

1721
runs:
1822
using: "composite"
@@ -22,6 +26,7 @@ runs:
2226
with:
2327
toolchain: ${{ inputs.toolchain }}
2428
components: ${{ inputs.components }}
29+
targets: ${{ inputs.targets }}
2530

2631
- name: Install protoc
2732
uses: arduino/setup-protoc@v3

.github/workflows/rust-test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,80 @@ jobs:
5656
cd client/crates/client
5757
cargo check --examples --verbose
5858
59+
feature-check:
60+
name: Feature Combination Check
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v5
65+
66+
- name: Setup Rust
67+
uses: ./.github/actions/rust-setup
68+
with:
69+
toolchain: stable
70+
components: rustfmt, clippy
71+
cache-key: features
72+
73+
- name: Check ev-types with no default features
74+
run: |
75+
cd client/crates/types
76+
# Check minimal build (just protobuf, no compression or grpc)
77+
cargo check --no-default-features --verbose
78+
79+
- name: Check ev-types with only std
80+
run: |
81+
cd client/crates/types
82+
cargo check --no-default-features --features std --verbose
83+
84+
- name: Check ev-types with compression only
85+
run: |
86+
cd client/crates/types
87+
cargo check --no-default-features --features compression --verbose
88+
89+
- name: Check ev-types with grpc only
90+
run: |
91+
cd client/crates/types
92+
cargo check --no-default-features --features grpc --verbose
93+
94+
- name: Check ev-types with default features
95+
run: |
96+
cd client/crates/types
97+
cargo check --verbose
98+
99+
no-std-check:
100+
name: No-std Compatibility Check
101+
runs-on: ubuntu-latest
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v5
105+
106+
- name: Setup Rust
107+
uses: ./.github/actions/rust-setup
108+
with:
109+
toolchain: stable
110+
components: rustfmt, clippy
111+
cache-key: no-std
112+
targets: thumbv7m-none-eabi
113+
114+
- name: Check no_std compatibility for ev-types
115+
run: |
116+
cd client/crates/types
117+
# Test that the crate builds for an embedded target without std
118+
cargo check --no-default-features --target thumbv7m-none-eabi --verbose
119+
120+
- name: Check no_std with alloc
121+
run: |
122+
cd client/crates/types
123+
# Some embedded systems have alloc but not std
124+
# This verifies we can use the crate with just alloc support
125+
cargo check --no-default-features --target thumbv7m-none-eabi --verbose
126+
127+
- name: Build for wasm32 target (another no_std target)
128+
run: |
129+
rustup target add wasm32-unknown-unknown
130+
cd client/crates/types
131+
cargo check --no-default-features --target wasm32-unknown-unknown --verbose
132+
59133
coverage:
60134
name: Code Coverage
61135
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)