-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (73 loc) · 1.91 KB
/
ci.yml
File metadata and controls
79 lines (73 loc) · 1.91 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Build
run: cargo build --verbose
- name: Run unit & integration tests
run: cargo test --verbose
- name: Run tests with FFI feature
run: cargo test --features ffi --verbose
- name: Run tests in release mode
run: cargo test --release --verbose
swift-ffi:
name: Swift FFI Tests
runs-on: macos-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
key: swift-ffi
- name: Build static library for Swift
run: cargo build --release --features ffi --target aarch64-apple-darwin
- name: Run Swift FFI smoke test
working-directory: swift-test
run: swift run NemoTest
wasm:
name: WASM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
key: wasm
- uses: jetli/wasm-pack-action@v0.4.0
- run: npm run wasm:ci