Skip to content

Commit f45ec5e

Browse files
committed
ci: Split clippy/tests across feature sets
1 parent ee3748a commit f45ec5e

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

.github/workflows/rust.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ jobs:
103103
clippy:
104104
name: Clippy
105105
runs-on: ubuntu-latest
106+
env:
107+
RUSTFLAGS: "${{ env.RUSTFLAGS }} -D warnings"
106108
steps:
107109
- uses: actions/checkout@v4
108110
- uses: dtolnay/rust-toolchain@stable
@@ -116,10 +118,12 @@ jobs:
116118
~/.cargo/git/db/
117119
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
118120
- uses: mozilla-actions/[email protected]
119-
- run: cargo clippy --all -- -D warnings
120-
- run: cargo clippy --all --features runtime-tokio-native-tls,sqlx-all -- -D warnings
121-
- run: cargo clippy --manifest-path sea-orm-cli/Cargo.toml -- -D warnings
122-
- run: cargo clippy --manifest-path sea-orm-migration/Cargo.toml -- -D warnings
121+
# Test sea-orm with all extra features and types
122+
- run: cargo clippy --all-targets --features runtime-tokio-native-tls,all-extra-features,all-types-1
123+
- run: cargo clippy --all-targets --features runtime-tokio-native-tls,all-extra-features,all-types-2
124+
- run: cargo clippy --all-targets --workspace --exclude sea-orm --features runtime-tokio-native-tls,sqlx-all
125+
- run: cargo clippy --all-targets --manifest-path sea-orm-cli/Cargo.toml
126+
- run: cargo clippy --all-targets --manifest-path sea-orm-migration/Cargo.toml
123127

124128
rustfmt:
125129
name: Rustfmt
@@ -185,7 +189,7 @@ jobs:
185189
cargo build --no-default-features --features seaography
186190
cargo build --features rbac,schema-sync
187191
- if: matrix.kind == 'test'
188-
run: cargo test --test '*' --features tests-features,${{ matrix.features }} --no-run
192+
run: cargo test --features tests-features,${{ matrix.features }} --no-run
189193

190194
test:
191195
name: Unit Test
@@ -208,6 +212,27 @@ jobs:
208212
- run: cargo test --manifest-path sea-orm-cli/Cargo.toml --no-run
209213
- run: cargo test --manifest-path sea-orm-cli/Cargo.toml
210214

215+
test-features:
216+
name: Unit Test with features
217+
runs-on: ubuntu-latest
218+
strategy:
219+
fail-fast: false
220+
matrix:
221+
features: ["all-types-1", "all-types-2"]
222+
steps:
223+
- uses: actions/checkout@v4
224+
- uses: dtolnay/rust-toolchain@stable
225+
- uses: actions/cache@v5
226+
with:
227+
path: |
228+
~/.cargo/registry/index/
229+
~/.cargo/registry/cache/
230+
~/.cargo/git/db/
231+
key: ${{ runner.os }}-cargo-test-features-${{ hashFiles('**/Cargo.toml') }}
232+
- uses: mozilla-actions/[email protected]
233+
- run: cargo test --features all-extra-features,${{ matrix.features }} --no-run
234+
- run: cargo test --features all-extra-features,${{ matrix.features }}
235+
211236
cli:
212237
name: CLI
213238
needs: init

Cargo.toml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,31 @@ with-rust_decimal = [
206206
]
207207
with-time = ["time", "sea-query/with-time", "sea-query-sqlx?/with-time"]
208208
with-uuid = ["uuid", "sea-query/with-uuid", "sea-query-sqlx?/with-uuid"]
209-
209+
# For testing
210+
__all-types = [
211+
"postgres-array",
212+
"postgres-vector",
213+
"with-ipnetwork",
214+
"with-json",
215+
"with-uuid",
216+
]
217+
all-extra-features = [
218+
"entity-registry",
219+
"mock",
220+
"proxy",
221+
"rbac",
222+
"schema-sync",
223+
]
224+
all-types-1 = [
225+
"__all-types",
226+
"with-chrono",
227+
"with-rust_decimal",
228+
]
229+
all-types-2 = [
230+
"__all-types",
231+
"with-bigdecimal",
232+
"with-time",
233+
]
210234
# This allows us to develop using a local version of sea-query
211235
[patch.crates-io]
212236
# sea-query = { path = "../sea-query" }

0 commit comments

Comments
 (0)