Skip to content

Commit

Permalink
build: add driver wasm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brianheineman committed Jan 9, 2025
1 parent a21cbc4 commit f8a152a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,28 @@ jobs:
- macos-arm64
- macos-x64
- windows-x64
- wasm32-unknown
- wasm32-wasi

include:
- platform: linux-x64
os: [ self-hosted, Linux, X64 ]
target: x86_64-unknown-linux-gnu
- platform: macos-arm64
os: macos-15
target: aarch64-apple-darwin
- platform: macos-x64
os: macos-13
target: x86_64-apple-darwin
- platform: windows-x64
os: windows-2022
target: x86_64-pc-windows-msvc
- platform: wasm32-unknown
os: ubuntu-latest
target: wasm32-unknown-unknown
- platform: wasm32-wasi
os: ubuntu-latest
target: wasm32-wasip1-threads

steps:
- name: Checkout source code
Expand All @@ -58,8 +70,19 @@ jobs:
with:
tool: cargo-llvm-cov

- name: Tests
if: ${{ !startsWith(matrix.platform, 'linux-') }}
- name: Build
if: ${{ startsWith(matrix.platform, 'wasm32-') }}
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUST_BACKTRACE: 1
RUST_LOG: info
run: |
rustup target install ${{ matrix.target }}
cargo build --package rsql_drivers --target ${{ matrix.target }}
- name: Test
if: ${{ !startsWith(matrix.platform, 'linux-') && !startsWith(matrix.platform, 'wasm32-') }}
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -69,7 +92,7 @@ jobs:
run: |
cargo test --workspace --features all
- name: Tests
- name: Test
if: ${{ startsWith(matrix.platform, 'linux-') }}
env:
CARGO_TERM_COLOR: always
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ duckdb = "0.10.2"
file_type = "0.2.1"
form_urlencoded = "1.2.1"
futures-util = "0.3.31"
getrandom = "0.2.15"
indexmap = "2.7.0"
indicatif = "0.17.9"
indoc = "2.0.5"
Expand Down
5 changes: 4 additions & 1 deletion rsql_drivers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sha2 = { workspace = true, optional = true }
sqlparser = { workspace = true }
sqlx = { workspace = true, features = ["bit-vec", "chrono", "json", "macros", "runtime-tokio", "rust_decimal", "time", "uuid"], optional = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt", "macros"] }
tokio-postgres = { workspace = true, features = ["array-impls", "with-bit-vec-0_6", "with-chrono-0_4", "with-serde_json-1", "with-uuid-1"], optional = true }
tokio-util = { workspace = true, features = ["compat"], optional = true }
tracing = { workspace = true }
Expand All @@ -62,6 +62,9 @@ features = ["bigdecimal", "chrono", "rust_decimal", "tds73", "time", "vendored-o
optional = true
workspace = true

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { workspace = true, features = ["js"] }

[dev-dependencies]
testcontainers = { workspace = true }
testcontainers-modules = { workspace = true, features = ["cockroach_db", "mariadb", "mssql_server", "mysql", "postgres"] }
Expand Down

0 comments on commit f8a152a

Please sign in to comment.