Skip to content

Commit d2f0cd0

Browse files
committed
Merge branch 'main' of github.com:awesomized/crc-fast-rust into add-x86-release-artifacts
2 parents bba891b + 43925bb commit d2f0cd0

38 files changed

+1713
-391
lines changed

.github/workflows/tests.yml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
toolchain: ${{ matrix.rust-toolchain }}
2424
components: rustfmt, clippy
25-
cache-key: ${{ matrix.os }}-${{ matrix.rust-toolchain }}
25+
cache-key: ${{ matrix.os }}-${{ matrix.rust-toolchain }}-v2
2626
- name: Check
2727
run: cargo check --all-features
2828
- name: Architecture check
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
toolchain: ${{ matrix.rust-toolchain }}
5555
components: rustfmt, clippy
56-
cache-key: ${{ matrix.os }}-${{ matrix.rust-toolchain }}
56+
cache-key: ${{ matrix.os }}-${{ matrix.rust-toolchain }}-v2
5757
- name: Check
5858
run: cargo check --all-features
5959
- name: Architecture check
@@ -173,4 +173,83 @@ jobs:
173173
run: cargo miri nextest run --all-features -j${{ steps.cores.outputs.count }}
174174
- name: Run Miri tests (serial)
175175
if: steps.cores.outputs.use_nextest == 'false'
176-
run: cargo miri test --all-features
176+
run: cargo miri test --all-features
177+
178+
test-no-std:
179+
name: Test no_std
180+
runs-on: ubuntu-latest
181+
strategy:
182+
matrix:
183+
target:
184+
- thumbv7em-none-eabihf # ARM Cortex-M4F/M7F
185+
- thumbv8m.main-none-eabihf # ARM Cortex-M33/M35P
186+
- riscv32imac-unknown-none-elf # RISC-V 32-bit
187+
rust-toolchain:
188+
- "1.81" # minimum for this crate
189+
- "stable"
190+
- "nightly"
191+
steps:
192+
- uses: actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
193+
- uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
194+
with:
195+
toolchain: ${{ matrix.rust-toolchain }}
196+
target: ${{ matrix.target }}
197+
components: rustfmt, clippy
198+
cache-key: ${{ matrix.target }}-${{ matrix.rust-toolchain }}-v2
199+
- name: Check no_std (no features)
200+
run: cargo check --target ${{ matrix.target }} --no-default-features --features panic-handler --lib
201+
- name: Check no_std with alloc
202+
run: cargo check --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib
203+
- name: Check no_std with cache
204+
run: cargo check --target ${{ matrix.target }} --no-default-features --features cache,panic-handler --lib
205+
- name: Run no_std tests (on host with std test harness)
206+
run: cargo test --test no_std_tests
207+
208+
test-wasm:
209+
name: Test WASM
210+
runs-on: ubuntu-latest
211+
strategy:
212+
matrix:
213+
include:
214+
# WASM 1.0/2.0 (32-bit) - all toolchains
215+
- target: wasm32-unknown-unknown
216+
rust-toolchain: "1.81"
217+
- target: wasm32-unknown-unknown
218+
rust-toolchain: "stable"
219+
- target: wasm32-unknown-unknown
220+
rust-toolchain: "nightly"
221+
# WASI preview 1 (32-bit) - all toolchains
222+
- target: wasm32-wasip1
223+
rust-toolchain: "1.81"
224+
- target: wasm32-wasip1
225+
rust-toolchain: "stable"
226+
- target: wasm32-wasip1
227+
rust-toolchain: "nightly"
228+
# WASI preview 2 (32-bit) - nightly only (experimental)
229+
- target: wasm32-wasip2
230+
rust-toolchain: "nightly"
231+
# Note: wasm64-unknown-unknown removed - not consistently available in nightly
232+
steps:
233+
- uses: actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
234+
- uses: actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
235+
with:
236+
toolchain: ${{ matrix.rust-toolchain }}
237+
target: ${{ matrix.target }}
238+
components: rustfmt, clippy
239+
cache-key: ${{ matrix.target }}-${{ matrix.rust-toolchain }}-v2
240+
- name: Check WASM (no features)
241+
run: cargo check --target ${{ matrix.target }} --no-default-features --features panic-handler --lib
242+
- name: Check WASM with alloc
243+
run: cargo check --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib
244+
- name: Check WASM with cache
245+
run: cargo check --target ${{ matrix.target }} --no-default-features --features cache,panic-handler --lib
246+
- name: Build WASM release
247+
run: cargo build --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib --release
248+
- name: Run WASM tests (on host with std test harness)
249+
run: cargo test --test wasm_tests
250+
- if: ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
251+
name: Install wasm-pack
252+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
253+
- if: ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
254+
name: Build WASM package with wasm-pack
255+
run: wasm-pack build --target web --no-default-features --features alloc,panic-handler

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
.idea
55
.DS_Store
66
.git
7-
.vscode
7+
.vscode

0 commit comments

Comments
 (0)