-
Notifications
You must be signed in to change notification settings - Fork 12
121 lines (112 loc) · 4.2 KB
/
ci.yml
File metadata and controls
121 lines (112 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --lib -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run library unit tests
run: cargo test --workspace --lib
- name: Run integration tests
run: |
cargo test --test compatibility_tests
cargo test --test integration_tests
cargo test --test derive_tests
cargo test --test axum_integration_tests
cargo test --test phase0_tests
cargo test --test meta_trait_tests
test-all-features:
name: Test (All Features)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tls: [native-tls, rustls]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run library unit tests (${{ matrix.tls }} + all non-TLS features)
run: cargo test --workspace --lib --no-default-features --features "${{ matrix.tls }},axum,derive,sqlx-postgres,redis-cache"
- name: Run integration tests (${{ matrix.tls }} + all non-TLS features)
run: |
FEATURES="${{ matrix.tls }},axum,derive,sqlx-postgres,redis-cache"
cargo test --test compatibility_tests --no-default-features --features "$FEATURES"
cargo test --test integration_tests --no-default-features --features "$FEATURES"
cargo test --test derive_tests --no-default-features --features "$FEATURES"
cargo test --test axum_integration_tests --no-default-features --features "$FEATURES"
cargo test --test phase0_tests --no-default-features --features "$FEATURES"
cargo test --test meta_trait_tests --no-default-features --features "$FEATURES"
compat:
name: Compatibility Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run spec-driven compatibility tests
run: |
cargo test --test compat_endpoint_tests -- --nocapture
cargo test --test compat_field_tests -- --nocapture
cargo test --test compat_coverage_tests -- --nocapture
cargo test --test compat_consistency_tests -- --nocapture
cargo test --test compat_unit_tests -- --nocapture
cargo test --test compat_admin_tests -- --nocapture
cargo test --test compat_organization_tests -- --nocapture
cargo test --test compat_passkey_tests -- --nocapture
p2-tests:
name: P2 Tests (Snapshot, Property, Dual-Server)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install reference server dependencies
run: npm ci
working-directory: compat-tests/reference-server
- name: Run snapshot tests
run: cargo test --test snapshot_tests -- --nocapture
- name: Run property tests
run: cargo test --test property_tests -- --nocapture
- name: Run dual-server comparison tests
run: cargo test --test dual_server_tests -- --nocapture
standalone-examples:
name: Check Standalone Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --manifest-path examples/sqlx-custom-entities/Cargo.toml
- run: cargo check --manifest-path examples/sea-orm-migration/Cargo.toml