Skip to content

Commit 5e99e34

Browse files
committed
ci: configure
Signed-off-by: Jeremie Drouet <jeremie.drouet@gmail.com>
1 parent e566f69 commit 5e99e34

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

.github/workflows/main.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
env:
14+
RUSTFLAGS: "-Dwarnings"
15+
16+
name: check
17+
jobs:
18+
fmt:
19+
runs-on: ubuntu-latest
20+
name: fmt
21+
steps:
22+
- uses: actions/checkout@v5
23+
- uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: rustfmt
26+
- name: cargo fmt --check --all
27+
run: cargo fmt --check --all
28+
29+
clippy:
30+
runs-on: ubuntu-latest
31+
name: clippy
32+
steps:
33+
- uses: actions/checkout@v5
34+
- uses: dtolnay/rust-toolchain@stable
35+
with:
36+
components: clippy
37+
- run: cargo clippy --all-features --all-targets --tests
38+
39+
test:
40+
runs-on: ubuntu-latest
41+
name: test
42+
steps:
43+
- uses: actions/checkout@v5
44+
- uses: dtolnay/rust-toolchain@stable
45+
- run: cargo test --workspace --all-features
46+
47+
features:
48+
runs-on: ubuntu-latest
49+
name: features
50+
steps:
51+
- uses: actions/checkout@v5
52+
- uses: dtolnay/rust-toolchain@stable
53+
- uses: taiki-e/install-action@v2
54+
with:
55+
tool: cargo-hack
56+
- name: features powerset
57+
run: cargo hack check --feature-powerset --tests

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2024"
55

66
[features]
7-
default = ["sqlite", "postgres"]
7+
default = []
88
postgres = ["sqlx/postgres"]
99
sqlite = ["sqlx/sqlite"]
1010

src/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn record_error(err: &sqlx::Error) {
1010
| sqlx::Error::ColumnNotFound(_)
1111
| sqlx::Error::Decode { .. }
1212
| sqlx::Error::Encode { .. }
13-
| sqlx::Error::RowNotFound { .. }
13+
| sqlx::Error::RowNotFound
1414
| sqlx::Error::TypeNotFound { .. } => {
1515
span.record("error.kind", "client");
1616
}

tests/postgres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg(feature = "sqlite")]
1+
#![cfg(feature = "postgres")]
22

33
use std::time::Duration;
44

0 commit comments

Comments
 (0)