-
Notifications
You must be signed in to change notification settings - Fork 40
91 lines (74 loc) · 2.08 KB
/
Copy pathcheck_and_test.yaml
File metadata and controls
91 lines (74 loc) · 2.08 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
name: Check and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch: { }
env:
CARGO_TERM_COLOR: always
DONT_SAVE_RESULT: 1
RAYON_NUM_THREADS: 4
jobs:
run_tests:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Check compilation for no_std
run: |
cargo build --no-default-features --features=no_std
- name: Run single-thread tests
run: |
cargo check
cargo test
- name: Run multi-thread tests
run: |
cargo check --features rayon
cargo test --features rayon
run_tests_for_wasm:
name: Test wasm32 on ubuntu-latest
runs-on: ubuntu-latest
env:
CARGO_BUILD_TARGET: "wasm32-wasip2"
CARGO_TARGET_WASM32_WASIP2_RUNNER: "wasmtime --dir=. --"
steps:
- uses: actions/checkout@v7
- name: Setup `wasmtime`
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "48.0.0"
- name: Install Rust toolchain and target
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# 1.95+ have regression in Wasm32 SIMD128 implementation.
toolchain: 1.94.1
target: wasm32-wasip2
cache-on-failure: "true"
rustflags: ""
- name: Check compilation for no_std
run: |
cargo build --no-default-features --features=no_std
- name: Run tests
run: |
cargo check
cargo test
doc:
name: Test documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain and target
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache-on-failure: "true"
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs