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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
permissions:
contents: read
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
run: |
# Run tests on native target only (not WASM)
cargo test --verbose --lib
- name: Check documentation
run: cargo doc --no-deps --document-private-items
check-wasm:
name: Check WASM Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-wasm-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check WASM build
run: |
# Only check compilation for WASM, don't run tests
# WASM binaries cannot be executed on GitHub runners
cargo check --target wasm32-unknown-unknown --no-default-features --features "cloudflare"
- name: Build WASM release
run: cargo build --target wasm32-unknown-unknown --no-default-features --features "cloudflare" --release
publish-dry-run:
name: Test Package Structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-publish-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check macro crate packaging
run: |
cd libsql-orm-macros
cargo package --allow-dirty
- name: Check main crate structure
run: |
# Main crate packaging will fail until macro crate is published to crates.io
# So we test the build instead to verify everything is correct
cargo build --release
echo "✅ Main crate structure test passed"
echo "ℹ️ Note: Main crate packaging will succeed only after macro crate is published to crates.io"