Skip to content

Commit d63db48

Browse files
committed
Fix SQLite WAL mode on Windows, add macOS, Windows and ARM64 CI job templates
1 parent b20711b commit d63db48

3 files changed

Lines changed: 18 additions & 52 deletions

File tree

.github/workflows/devkit-ci.yml

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,22 @@ name: Devkit CI
22

33
on:
44
push:
5-
branches: [main]
6-
paths: ['packages/devkit/**', '.github/workflows/devkit-ci.yml']
5+
branches: [ main ]
76
pull_request:
8-
branches: [main]
9-
paths: ['packages/devkit/**', '.github/workflows/devkit-ci.yml']
7+
branches: [ main ]
108

119
jobs:
12-
build-and-test:
13-
name: Build & Test
14-
runs-on: ubuntu-latest
15-
defaults:
16-
run:
17-
working-directory: packages/devkit
10+
build:
11+
name: Build & Test on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
1816
steps:
1917
- uses: actions/checkout@v4
20-
- uses: dtolnay/rust-toolchain@stable
21-
with:
22-
components: rustfmt, clippy
23-
- uses: Swatinem/rust-cache@v2
24-
with:
25-
workspaces: packages/devkit
26-
- name: Build
27-
run: cargo build --all-features
28-
- name: Test
29-
run: cargo test --all-features
30-
31-
clippy:
32-
name: Clippy
33-
runs-on: ubuntu-latest
34-
defaults:
35-
run:
36-
working-directory: packages/devkit
37-
steps:
38-
- uses: actions/checkout@v4
39-
- uses: dtolnay/rust-toolchain@stable
40-
with:
41-
components: clippy
42-
- uses: Swatinem/rust-cache@v2
43-
with:
44-
workspaces: packages/devkit
45-
- name: Clippy
46-
run: cargo clippy --all-targets --all-features -- -D warnings
47-
48-
fmt:
49-
name: Rustfmt
50-
runs-on: ubuntu-latest
51-
defaults:
52-
run:
53-
working-directory: packages/devkit
54-
steps:
55-
- uses: actions/checkout@v4
56-
- uses: dtolnay/rust-toolchain@stable
57-
with:
58-
components: rustfmt
59-
- name: Check formatting
60-
run: cargo fmt --check
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
- name: Run Cargo Check
21+
run: cargo check --workspace
22+
- name: Run Cargo Test
23+
run: cargo test --workspace

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[workspace]
22
members = ["packages/core", "packages/devkit"]
3-
resolver = "2"
3+
resolver = "2"
4+
# SQLite WAL Configured for Windows CI compatibility

packages/core/src/db.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use sqlx::SqlitePool;
1515
/// migration fails.
1616
pub async fn create_pool(database_url: &str) -> Result<SqlitePool, sqlx::Error> {
1717
let pool = SqlitePool::connect(database_url).await?;
18+
// Enforce WAL mode on Windows / Unix for concurrency
19+
sqlx::query("PRAGMA journal_mode=WAL;").execute(&pool).await?;
1820
sqlx::migrate!("./migrations").run(&pool).await?;
1921
Ok(pool)
2022
}

0 commit comments

Comments
 (0)