1+ name : Tests
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ env :
10+ CARGO_TERM_COLOR : always
11+ RUSTFLAGS : " -D warnings"
12+
13+ jobs :
14+ non-wasm-tests :
15+ name : Non-WASM Tests - ${{ matrix.crate }}
16+ runs-on : ubuntu-latest
17+ strategy :
18+ fail-fast : false
19+ matrix :
20+ crate :
21+ - shared
22+ - backend
23+ - cli
24+ - utils
25+ - diesel-test
26+ - meta_tools
27+ - github_webhook_body
28+ - macros
29+ - macros_impl
30+ - github_api
31+ - reqwest_wiremock
32+ - zwang_router
33+
34+ steps :
35+ - uses : actions/checkout@v4
36+
37+ - name : Install Rust toolchain
38+ uses : dtolnay/rust-toolchain@nightly
39+
40+ - name : Cache dependencies
41+ uses : Swatinem/rust-cache@v2
42+
43+ - name : Run tests for ${{ matrix.crate }}
44+ run : cargo test -p ${{ matrix.crate }}
45+
46+ wasm-tests :
47+ name : WASM Tests
48+ runs-on : ubuntu-latest
49+ steps :
50+ - uses : actions/checkout@v4
51+
52+ - name : Install Rust toolchain
53+ uses : dtolnay/rust-toolchain@nightly
54+ with :
55+ targets : wasm32-unknown-unknown
56+
57+ - name : Install wasm-pack
58+ run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
59+
60+ - name : Cache dependencies
61+ uses : Swatinem/rust-cache@v2
62+
63+ - name : Run WASM tests for web
64+ run : wasm-pack test --headless --chrome web
65+
66+ - name : Run WASM tests for typesafe_idb
67+ run : wasm-pack test --headless --chrome typesafe_idb
68+
69+ - name : Run WASM tests for wasm_testing_utils
70+ run : wasm-pack test --headless --chrome wasm_testing_utils
71+
72+ web-tests :
73+ name : Web Tests (Non-WASM)
74+ runs-on : ubuntu-latest
75+ steps :
76+ - uses : actions/checkout@v4
77+
78+ - name : Install Rust toolchain
79+ uses : dtolnay/rust-toolchain@nightly
80+
81+ - name : Cache dependencies
82+ uses : Swatinem/rust-cache@v2
83+
84+ - name : Run non-WASM tests for web crate
85+ run : cargo test -p web --lib --bins --tests
0 commit comments