Skip to content

Commit dab9760

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

2 files changed

Lines changed: 53 additions & 7 deletions

File tree

.github/workflows/rust.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ jobs:
114114
~/.cargo/registry/index/
115115
~/.cargo/registry/cache/
116116
~/.cargo/git/db/
117-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
117+
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.toml') }}
118118
- uses: mozilla-actions/sccache-action@v0.0.9
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
119+
- run: cargo clippy --all-targets --features runtime-tokio-native-tls,all-extra-features,all-types-1 -- -D warnings
120+
- run: cargo clippy --all-targets --features runtime-tokio-native-tls,all-extra-features,all-types-2 -- -D warnings
121+
- run: cargo clippy --all-targets --workspace --exclude sea-orm --features runtime-tokio-native-tls,sqlx-all -- -D warnings
122+
- run: cargo clippy --all-targets --manifest-path sea-orm-cli/Cargo.toml -- -D warnings
123+
- run: cargo clippy --all-targets --manifest-path sea-orm-migration/Cargo.toml -- -D warnings
123124

124125
rustfmt:
125126
name: Rustfmt
@@ -185,7 +186,7 @@ jobs:
185186
cargo build --no-default-features --features seaography
186187
cargo build --features rbac,schema-sync
187188
- if: matrix.kind == 'test'
188-
run: cargo test --test '*' --features tests-features,${{ matrix.features }} --no-run
189+
run: cargo test --features tests-features,${{ matrix.features }} --no-run
189190

190191
test:
191192
name: Unit Test
@@ -208,6 +209,27 @@ jobs:
208209
- run: cargo test --manifest-path sea-orm-cli/Cargo.toml --no-run
209210
- run: cargo test --manifest-path sea-orm-cli/Cargo.toml
210211

212+
test-features:
213+
name: Unit Test with features
214+
runs-on: ubuntu-latest
215+
strategy:
216+
fail-fast: false
217+
matrix:
218+
features: ["all-types-1", "all-types-2"]
219+
steps:
220+
- uses: actions/checkout@v4
221+
- uses: dtolnay/rust-toolchain@stable
222+
- uses: actions/cache@v5
223+
with:
224+
path: |
225+
~/.cargo/registry/index/
226+
~/.cargo/registry/cache/
227+
~/.cargo/git/db/
228+
key: ${{ runner.os }}-cargo-test-features-${{ hashFiles('**/Cargo.toml') }}
229+
- uses: mozilla-actions/sccache-action@v0.0.9
230+
- run: cargo test --features all-extra-features,${{ matrix.features }} --no-run
231+
- run: cargo test --features all-extra-features,${{ matrix.features }}
232+
211233
cli:
212234
name: CLI
213235
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)